@splunk/react-ui 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/Badge.js +154 -0
  2. package/CHANGELOG.md +27 -0
  3. package/Code.js +1097 -500
  4. package/Color.js +142 -141
  5. package/ComboBox.js +6 -5
  6. package/Link.js +74 -44
  7. package/MIGRATION.md +32 -1
  8. package/Menu.js +41 -43
  9. package/Multiselect.js +596 -2143
  10. package/Number.js +3 -3
  11. package/PhoneNumber.d.ts +2 -0
  12. package/PhoneNumber.js +769 -0
  13. package/Popover.js +73 -75
  14. package/RadioList.js +166 -151
  15. package/ResultsMenu.js +27 -29
  16. package/Select.js +179 -1768
  17. package/SelectBase.d.ts +2 -0
  18. package/SelectBase.js +1681 -0
  19. package/Slider.js +202 -199
  20. package/SlidingPanels.js +55 -62
  21. package/Switch.js +42 -27
  22. package/TabBar.js +295 -294
  23. package/TabLayout.js +14 -14
  24. package/Table.js +1087 -1040
  25. package/TransitionOpen.js +82 -74
  26. package/docker-compose.yml +99 -52
  27. package/package.json +9 -5
  28. package/stubs-splunkui.d.ts +0 -86
  29. package/test-runner-jest.config.js +1 -0
  30. package/types/src/Badge/Badge.d.ts +29 -0
  31. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  32. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  33. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  34. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  35. package/types/src/Badge/index.d.ts +2 -0
  36. package/types/src/Code/Code.d.ts +4 -3
  37. package/types/src/Code/index.d.ts +1 -0
  38. package/types/src/Link/Link.d.ts +4 -0
  39. package/types/src/Link/LinkContext.d.ts +14 -0
  40. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  41. package/types/src/Link/index.d.ts +1 -0
  42. package/types/src/Multiselect/Compact.d.ts +1 -1
  43. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  44. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  45. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  46. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  47. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  48. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  49. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  50. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  51. package/types/src/PhoneNumber/index.d.ts +2 -0
  52. package/types/src/PhoneNumber/utils.d.ts +47 -0
  53. package/types/src/RadioList/Option.d.ts +6 -1
  54. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  55. package/types/src/Select/Option.d.ts +8 -3
  56. package/types/src/Select/Select.d.ts +1 -1
  57. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  58. package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
  59. package/types/src/SelectBase/index.d.ts +2 -0
  60. package/types/src/Switch/Switch.d.ts +3 -0
  61. package/types/src/Table/Body.d.ts +6 -1
  62. package/types/src/Table/Cell.d.ts +5 -1
  63. package/types/src/Table/Head.d.ts +6 -2
  64. package/types/src/Table/HeadCell.d.ts +5 -1
  65. package/types/src/Table/Row.d.ts +5 -1
  66. package/types/src/Table/Table.d.ts +20 -1
  67. package/types/src/Table/TableContext.d.ts +1 -0
  68. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  69. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  70. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  71. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  72. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  73. package/usePrevious.d.ts +2 -0
  74. package/useResizeObserver.js +59 -92
  75. package/useRovingFocus.js +96 -41
  76. /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/Code.js CHANGED
@@ -7,7 +7,7 @@
7
7
  var t = undefined;
8
8
  var n = undefined;
9
9
  /// <reference lib="WebWorker"/>
10
- var a = typeof t !== "undefined" ? t : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
10
+ var r = typeof t !== "undefined" ? t : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
11
11
  /**
12
12
  * Prism: Lightweight, robust, elegant syntax highlighting
13
13
  *
@@ -15,13 +15,13 @@
15
15
  * @author Lea Verou <https://lea.verou.me>
16
16
  * @namespace
17
17
  * @public
18
- */ var r = function(e) {
18
+ */ var a = function(e) {
19
19
  // Private helper vars
20
20
  var n = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
21
- var a = 0;
21
+ var r = 0;
22
22
  // The grammar object for plaintext
23
- var r = {};
24
- var i = {
23
+ var a = {};
24
+ var s = {
25
25
  /**
26
26
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
27
27
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -77,8 +77,8 @@
77
77
  */
78
78
  util: {
79
79
  encode: function e(t) {
80
- if (t instanceof s) {
81
- return new s(t.type, e(t.content), t.alias);
80
+ if (t instanceof i) {
81
+ return new i(t.type, e(t.content), t.alias);
82
82
  } else if (Array.isArray(t)) {
83
83
  return t.map(e);
84
84
  } else {
@@ -113,7 +113,7 @@
113
113
  objId: function(e) {
114
114
  if (!e["__id"]) {
115
115
  Object.defineProperty(e, "__id", {
116
- value: ++a
116
+ value: ++r
117
117
  });
118
118
  }
119
119
  return e["__id"];
@@ -130,36 +130,36 @@
130
130
  */
131
131
  clone: function e(t, n) {
132
132
  n = n || {};
133
- var a;
134
133
  var r;
135
- switch (i.util.type(t)) {
134
+ var a;
135
+ switch (s.util.type(t)) {
136
136
  case "Object":
137
- r = i.util.objId(t);
138
- if (n[r]) {
139
- return n[r];
137
+ a = s.util.objId(t);
138
+ if (n[a]) {
139
+ return n[a];
140
140
  }
141
- a = /** @type {Record<string, any>} */ {};
142
- n[r] = a;
143
- for (var s in t) {
144
- if (t.hasOwnProperty(s)) {
145
- a[s] = e(t[s], n);
141
+ r = /** @type {Record<string, any>} */ {};
142
+ n[a] = r;
143
+ for (var i in t) {
144
+ if (t.hasOwnProperty(i)) {
145
+ r[i] = e(t[i], n);
146
146
  }
147
147
  }
148
148
  /** @type {any} */
149
- return a;
149
+ return r;
150
150
 
151
151
  case "Array":
152
- r = i.util.objId(t);
153
- if (n[r]) {
154
- return n[r];
152
+ a = s.util.objId(t);
153
+ if (n[a]) {
154
+ return n[a];
155
155
  }
156
- a = [];
157
- n[r] = a;
158
- /** @type {Array} */ /** @type {any} */ t.forEach((function(t, r) {
159
- a[r] = e(t, n);
156
+ r = [];
157
+ n[a] = r;
158
+ /** @type {Array} */ /** @type {any} */ t.forEach((function(t, a) {
159
+ r[a] = e(t, n);
160
160
  }));
161
161
  /** @type {any} */
162
- return a;
162
+ return r;
163
163
 
164
164
  default:
165
165
  return t;
@@ -218,13 +218,13 @@
218
218
  // this will not work for inline scripts
219
219
  try {
220
220
  throw new Error;
221
- } catch (a) {
221
+ } catch (r) {
222
222
  // Get file src url from stack. Specifically works with the format of stack traces in IE.
223
223
  // A stack will look like this:
224
224
  // Error
225
225
  // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
226
226
  // at Global code (http://localhost/components/prism-core.js:606:1)
227
- var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack) || [])[1];
227
+ var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
228
228
  if (e) {
229
229
  var t = document.getElementsByTagName("script");
230
230
  for (var n in t) {
@@ -256,13 +256,13 @@
256
256
  * @returns {boolean}
257
257
  */
258
258
  isActive: function(e, t, n) {
259
- var a = "no-" + t;
259
+ var r = "no-" + t;
260
260
  while (e) {
261
- var r = e.classList;
262
- if (r.contains(t)) {
261
+ var a = e.classList;
262
+ if (a.contains(t)) {
263
263
  return true;
264
264
  }
265
- if (r.contains(a)) {
265
+ if (a.contains(r)) {
266
266
  return false;
267
267
  }
268
268
  e = e.parentElement;
@@ -281,10 +281,10 @@
281
281
  /**
282
282
  * The grammar for plain, unformatted text.
283
283
  */
284
- plain: r,
285
- plaintext: r,
286
- text: r,
287
- txt: r,
284
+ plain: a,
285
+ plaintext: a,
286
+ text: a,
287
+ txt: a,
288
288
  /**
289
289
  * Creates a deep copy of the language with the given id and appends the given tokens.
290
290
  *
@@ -314,9 +314,9 @@
314
314
  * });
315
315
  */
316
316
  extend: function(e, t) {
317
- var n = i.util.clone(i.languages[e]);
318
- for (var a in t) {
319
- n[a] = t[a];
317
+ var n = s.util.clone(s.languages[e]);
318
+ for (var r in t) {
319
+ n[r] = t[r];
320
320
  }
321
321
  return n;
322
322
  },
@@ -395,50 +395,50 @@
395
395
  * @returns {Grammar} The new grammar object.
396
396
  * @public
397
397
  */
398
- insertBefore: function(e, t, n, a) {
399
- a = a || /** @type {any} */ i.languages;
400
- var r = a[e];
401
- /** @type {Grammar} */ var s = {};
402
- for (var o in r) {
403
- if (r.hasOwnProperty(o)) {
398
+ insertBefore: function(e, t, n, r) {
399
+ r = r || /** @type {any} */ s.languages;
400
+ var a = r[e];
401
+ /** @type {Grammar} */ var i = {};
402
+ for (var o in a) {
403
+ if (a.hasOwnProperty(o)) {
404
404
  if (o == t) {
405
405
  for (var l in n) {
406
406
  if (n.hasOwnProperty(l)) {
407
- s[l] = n[l];
407
+ i[l] = n[l];
408
408
  }
409
409
  }
410
410
  }
411
411
  // Do not insert token which also occur in insert. See #1525
412
412
  if (!n.hasOwnProperty(o)) {
413
- s[o] = r[o];
413
+ i[o] = a[o];
414
414
  }
415
415
  }
416
416
  }
417
- var u = a[e];
418
- a[e] = s;
417
+ var u = r[e];
418
+ r[e] = i;
419
419
  // Update references in other language definitions
420
- i.languages.DFS(i.languages, (function(t, n) {
420
+ s.languages.DFS(s.languages, (function(t, n) {
421
421
  if (n === u && t != e) {
422
- this[t] = s;
422
+ this[t] = i;
423
423
  }
424
424
  }));
425
- return s;
425
+ return i;
426
426
  },
427
427
  // Traverse a language definition with Depth First Search
428
- DFS: function e(t, n, a, r) {
429
- r = r || {};
430
- var s = i.util.objId;
428
+ DFS: function e(t, n, r, a) {
429
+ a = a || {};
430
+ var i = s.util.objId;
431
431
  for (var o in t) {
432
432
  if (t.hasOwnProperty(o)) {
433
- n.call(t, o, t[o], a || o);
433
+ n.call(t, o, t[o], r || o);
434
434
  var l = t[o];
435
- var u = i.util.type(l);
436
- if (u === "Object" && !r[s(l)]) {
437
- r[s(l)] = true;
438
- e(l, n, null, r);
439
- } else if (u === "Array" && !r[s(l)]) {
440
- r[s(l)] = true;
441
- e(l, n, o, r);
435
+ var u = s.util.type(l);
436
+ if (u === "Object" && !a[i(l)]) {
437
+ a[i(l)] = true;
438
+ e(l, n, null, a);
439
+ } else if (u === "Array" && !a[i(l)]) {
440
+ a[i(l)] = true;
441
+ e(l, n, o, a);
442
442
  }
443
443
  }
444
444
  }
@@ -458,7 +458,7 @@
458
458
  * @public
459
459
  */
460
460
  highlightAll: function(e, t) {
461
- i.highlightAllUnder(document, e, t);
461
+ s.highlightAllUnder(document, e, t);
462
462
  },
463
463
  /**
464
464
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
@@ -476,16 +476,16 @@
476
476
  * @public
477
477
  */
478
478
  highlightAllUnder: function(e, t, n) {
479
- var a = {
479
+ var r = {
480
480
  callback: n,
481
481
  container: e,
482
482
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
483
483
  };
484
- i.hooks.run("before-highlightall", a);
485
- a.elements = Array.prototype.slice.apply(a.container.querySelectorAll(a.selector));
486
- i.hooks.run("before-all-elements-highlight", a);
487
- for (var r = 0, s; s = a.elements[r++]; ) {
488
- i.highlightElement(s, t === true, a.callback);
484
+ s.hooks.run("before-highlightall", r);
485
+ r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector));
486
+ s.hooks.run("before-all-elements-highlight", r);
487
+ for (var a = 0, i; i = r.elements[a++]; ) {
488
+ s.highlightElement(i, t === true, r.callback);
489
489
  }
490
490
  },
491
491
  /**
@@ -516,50 +516,50 @@
516
516
  * @memberof Prism
517
517
  * @public
518
518
  */
519
- highlightElement: function(t, n, a) {
519
+ highlightElement: function(t, n, r) {
520
520
  // Find language
521
- var r = i.util.getLanguage(t);
522
- var s = i.languages[r];
521
+ var a = s.util.getLanguage(t);
522
+ var i = s.languages[a];
523
523
  // Set language on the element, if not present
524
- i.util.setLanguage(t, r);
524
+ s.util.setLanguage(t, a);
525
525
  // Set language on the parent, for styling
526
526
  var o = t.parentElement;
527
527
  if (o && o.nodeName.toLowerCase() === "pre") {
528
- i.util.setLanguage(o, r);
528
+ s.util.setLanguage(o, a);
529
529
  }
530
530
  var l = t.textContent;
531
531
  var u = {
532
532
  element: t,
533
- language: r,
534
- grammar: s,
533
+ language: a,
534
+ grammar: i,
535
535
  code: l
536
536
  };
537
537
  function c(e) {
538
538
  u.highlightedCode = e;
539
- i.hooks.run("before-insert", u);
539
+ s.hooks.run("before-insert", u);
540
540
  u.element.innerHTML = u.highlightedCode;
541
- i.hooks.run("after-highlight", u);
542
- i.hooks.run("complete", u);
543
- a && a.call(u.element);
541
+ s.hooks.run("after-highlight", u);
542
+ s.hooks.run("complete", u);
543
+ r && r.call(u.element);
544
544
  }
545
- i.hooks.run("before-sanity-check", u);
545
+ s.hooks.run("before-sanity-check", u);
546
546
  // plugins may change/add the parent/element
547
547
  o = u.element.parentElement;
548
548
  if (o && o.nodeName.toLowerCase() === "pre" && !o.hasAttribute("tabindex")) {
549
549
  o.setAttribute("tabindex", "0");
550
550
  }
551
551
  if (!u.code) {
552
- i.hooks.run("complete", u);
553
- a && a.call(u.element);
552
+ s.hooks.run("complete", u);
553
+ r && r.call(u.element);
554
554
  return;
555
555
  }
556
- i.hooks.run("before-highlight", u);
556
+ s.hooks.run("before-highlight", u);
557
557
  if (!u.grammar) {
558
- c(i.util.encode(u.code));
558
+ c(s.util.encode(u.code));
559
559
  return;
560
560
  }
561
561
  if (n && e.Worker) {
562
- var p = new Worker(i.filename);
562
+ var p = new Worker(s.filename);
563
563
  p.onmessage = function(e) {
564
564
  c(e.data);
565
565
  };
@@ -569,7 +569,7 @@
569
569
  immediateClose: true
570
570
  }));
571
571
  } else {
572
- c(i.highlight(u.code, u.grammar, u.language));
572
+ c(s.highlight(u.code, u.grammar, u.language));
573
573
  }
574
574
  },
575
575
  /**
@@ -593,18 +593,18 @@
593
593
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
594
594
  */
595
595
  highlight: function(e, t, n) {
596
- var a = {
596
+ var r = {
597
597
  code: e,
598
598
  grammar: t,
599
599
  language: n
600
600
  };
601
- i.hooks.run("before-tokenize", a);
602
- if (!a.grammar) {
603
- throw new Error('The language "' + a.language + '" has no grammar.');
601
+ s.hooks.run("before-tokenize", r);
602
+ if (!r.grammar) {
603
+ throw new Error('The language "' + r.language + '" has no grammar.');
604
604
  }
605
- a.tokens = i.tokenize(a.code, a.grammar);
606
- i.hooks.run("after-tokenize", a);
607
- return s.stringify(i.util.encode(a.tokens), a.language);
605
+ r.tokens = s.tokenize(r.code, r.grammar);
606
+ s.hooks.run("after-tokenize", r);
607
+ return i.stringify(s.util.encode(r.tokens), r.language);
608
608
  },
609
609
  /**
610
610
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -633,15 +633,15 @@
633
633
  tokenize: function(e, t) {
634
634
  var n = t.rest;
635
635
  if (n) {
636
- for (var a in n) {
637
- t[a] = n[a];
636
+ for (var r in n) {
637
+ t[r] = n[r];
638
638
  }
639
639
  delete t.rest;
640
640
  }
641
- var r = new u;
642
- c(r, r.head, e);
643
- l(e, r, t, r.head, 0);
644
- return d(r);
641
+ var a = new u;
642
+ c(a, a.head, e);
643
+ l(e, a, t, a.head, 0);
644
+ return d(a);
645
645
  },
646
646
  /**
647
647
  * @namespace
@@ -663,7 +663,7 @@
663
663
  * @public
664
664
  */
665
665
  add: function(e, t) {
666
- var n = i.hooks.all;
666
+ var n = s.hooks.all;
667
667
  n[e] = n[e] || [];
668
668
  n[e].push(t);
669
669
  },
@@ -677,18 +677,18 @@
677
677
  * @public
678
678
  */
679
679
  run: function(e, t) {
680
- var n = i.hooks.all[e];
680
+ var n = s.hooks.all[e];
681
681
  if (!n || !n.length) {
682
682
  return;
683
683
  }
684
- for (var a = 0, r; r = n[a++]; ) {
685
- r(t);
684
+ for (var r = 0, a; a = n[r++]; ) {
685
+ a(t);
686
686
  }
687
687
  }
688
688
  },
689
- Token: s
689
+ Token: i
690
690
  };
691
- e.Prism = i;
691
+ e.Prism = s;
692
692
  // Typescript note:
693
693
  // The following can be used to import the Token type in JSDoc:
694
694
 
@@ -703,7 +703,7 @@
703
703
  * @class
704
704
  * @global
705
705
  * @public
706
- */ function s(e, t, n, a) {
706
+ */ function i(e, t, n, r) {
707
707
  /**
708
708
  * The type of the token.
709
709
  *
@@ -730,7 +730,7 @@
730
730
  * @public
731
731
  */ this.alias = n;
732
732
  // Copy of the full string this token was created from
733
- this.length = (a || "").length | 0;
733
+ this.length = (r || "").length | 0;
734
734
  }
735
735
  /**
736
736
  * A token stream is an array of strings and {@link Token Token} objects.
@@ -758,18 +758,18 @@
758
758
  * @returns {string} The HTML representation of the token or token stream.
759
759
  * @memberof Token
760
760
  * @static
761
- */ s.stringify = function e(t, n) {
761
+ */ i.stringify = function e(t, n) {
762
762
  if (typeof t == "string") {
763
763
  return t;
764
764
  }
765
765
  if (Array.isArray(t)) {
766
- var a = "";
766
+ var r = "";
767
767
  t.forEach((function(t) {
768
- a += e(t, n);
768
+ r += e(t, n);
769
769
  }));
770
- return a;
770
+ return r;
771
771
  }
772
- var r = {
772
+ var a = {
773
773
  type: t.type,
774
774
  content: e(t.content, n),
775
775
  tag: "span",
@@ -777,20 +777,20 @@
777
777
  attributes: {},
778
778
  language: n
779
779
  };
780
- var s = t.alias;
781
- if (s) {
782
- if (Array.isArray(s)) {
783
- Array.prototype.push.apply(r.classes, s);
780
+ var i = t.alias;
781
+ if (i) {
782
+ if (Array.isArray(i)) {
783
+ Array.prototype.push.apply(a.classes, i);
784
784
  } else {
785
- r.classes.push(s);
785
+ a.classes.push(i);
786
786
  }
787
787
  }
788
- i.hooks.run("wrap", r);
788
+ s.hooks.run("wrap", a);
789
789
  var o = "";
790
- for (var l in r.attributes) {
791
- o += " " + l + '="' + (r.attributes[l] || "").replace(/"/g, "&quot;") + '"';
790
+ for (var l in a.attributes) {
791
+ o += " " + l + '="' + (a.attributes[l] || "").replace(/"/g, "&quot;") + '"';
792
792
  }
793
- return "<" + r.tag + ' class="' + r.classes.join(" ") + '"' + o + ">" + r.content + "</" + r.tag + ">";
793
+ return "<" + a.tag + ' class="' + a.classes.join(" ") + '"' + o + ">" + a.content + "</" + a.tag + ">";
794
794
  };
795
795
  /**
796
796
  * @param {RegExp} pattern
@@ -798,16 +798,16 @@
798
798
  * @param {string} text
799
799
  * @param {boolean} lookbehind
800
800
  * @returns {RegExpExecArray | null}
801
- */ function o(e, t, n, a) {
801
+ */ function o(e, t, n, r) {
802
802
  e.lastIndex = t;
803
- var r = e.exec(n);
804
- if (r && a && r[1]) {
803
+ var a = e.exec(n);
804
+ if (a && r && a[1]) {
805
805
  // change the match to remove the text matched by the Prism lookbehind group
806
- var i = r[1].length;
807
- r.index += i;
808
- r[0] = r[0].slice(i);
806
+ var s = a[1].length;
807
+ a.index += s;
808
+ a[0] = a[0].slice(s);
809
809
  }
810
- return r;
810
+ return a;
811
811
  }
812
812
  /**
813
813
  * @param {string} text
@@ -822,7 +822,7 @@
822
822
  * @typedef RematchOptions
823
823
  * @property {string} cause
824
824
  * @property {number} reach
825
- */ function l(e, t, n, a, r, u) {
825
+ */ function l(e, t, n, r, a, u) {
826
826
  for (var d in n) {
827
827
  if (!n.hasOwnProperty(d) || !n[d]) {
828
828
  continue;
@@ -834,97 +834,97 @@
834
834
  return;
835
835
  }
836
836
  var m = g[f];
837
- var E = m.inside;
838
- var v = !!m.lookbehind;
839
- var h = !!m.greedy;
840
- var b = m.alias;
841
- if (h && !m.pattern.global) {
837
+ var b = m.inside;
838
+ var h = !!m.lookbehind;
839
+ var v = !!m.greedy;
840
+ var E = m.alias;
841
+ if (v && !m.pattern.global) {
842
842
  // Without the global flag, lastIndex won't work
843
843
  var y = m.pattern.toString().match(/[imsuy]*$/)[0];
844
844
  m.pattern = RegExp(m.pattern.source, y + "g");
845
845
  }
846
846
  /** @type {RegExp} */ var S = m.pattern || m;
847
847
  for (// iterate the token list and keep track of the current token/string position
848
- var A = a.next, T = r; A !== t.tail; T += A.value.length, A = A.next) {
849
- if (u && T >= u.reach) {
848
+ var A = r.next, k = a; A !== t.tail; k += A.value.length, A = A.next) {
849
+ if (u && k >= u.reach) {
850
850
  break;
851
851
  }
852
- var I = A.value;
852
+ var x = A.value;
853
853
  if (t.length > e.length) {
854
854
  // Something went terribly wrong, ABORT, ABORT!
855
855
  return;
856
856
  }
857
- if (I instanceof s) {
857
+ if (x instanceof i) {
858
858
  continue;
859
859
  }
860
- var O = 1;
860
+ var T = 1;
861
861
  // this is the to parameter of removeBetween
862
- var N;
863
- if (h) {
864
- N = o(S, T, e, v);
865
- if (!N || N.index >= e.length) {
862
+ var I;
863
+ if (v) {
864
+ I = o(S, k, e, h);
865
+ if (!I || I.index >= e.length) {
866
866
  break;
867
867
  }
868
- var x = N.index;
869
- var R = N.index + N[0].length;
870
- var k = T;
868
+ var R = I.index;
869
+ var w = I.index + I[0].length;
870
+ var N = k;
871
871
  // find the node that contains the match
872
- k += A.value.length;
873
- while (x >= k) {
872
+ N += A.value.length;
873
+ while (R >= N) {
874
874
  A = A.next;
875
- k += A.value.length;
875
+ N += A.value.length;
876
876
  }
877
877
  // adjust pos (and p)
878
- k -= A.value.length;
879
- T = k;
878
+ N -= A.value.length;
879
+ k = N;
880
880
  // the current node is a Token, then the match starts inside another Token, which is invalid
881
- if (A.value instanceof s) {
881
+ if (A.value instanceof i) {
882
882
  continue;
883
883
  }
884
884
  // find the last node which is affected by this match
885
- for (var L = A; L !== t.tail && (k < R || typeof L.value === "string"); L = L.next) {
886
- O++;
887
- k += L.value.length;
885
+ for (var O = A; O !== t.tail && (N < w || typeof O.value === "string"); O = O.next) {
886
+ T++;
887
+ N += O.value.length;
888
888
  }
889
- O--;
889
+ T--;
890
890
  // replace with the new match
891
- I = e.slice(T, k);
892
- N.index -= T;
891
+ x = e.slice(k, N);
892
+ I.index -= k;
893
893
  } else {
894
- N = o(S, 0, I, v);
895
- if (!N) {
894
+ I = o(S, 0, x, h);
895
+ if (!I) {
896
896
  continue;
897
897
  }
898
898
  }
899
899
  // eslint-disable-next-line no-redeclare
900
- var x = N.index;
901
- var F = N[0];
902
- var w = I.slice(0, x);
903
- var C = I.slice(x + F.length);
904
- var D = T + I.length;
905
- if (u && D > u.reach) {
906
- u.reach = D;
900
+ var R = I.index;
901
+ var _ = I[0];
902
+ var L = x.slice(0, R);
903
+ var F = x.slice(R + _.length);
904
+ var C = k + x.length;
905
+ if (u && C > u.reach) {
906
+ u.reach = C;
907
907
  }
908
- var P = A.prev;
909
- if (w) {
910
- P = c(t, P, w);
911
- T += w.length;
908
+ var D = A.prev;
909
+ if (L) {
910
+ D = c(t, D, L);
911
+ k += L.length;
912
912
  }
913
- p(t, P, O);
914
- var _ = new s(d, E ? i.tokenize(F, E) : F, b, F);
915
- A = c(t, P, _);
916
- if (C) {
917
- c(t, A, C);
913
+ p(t, D, T);
914
+ var P = new i(d, b ? s.tokenize(_, b) : _, E, _);
915
+ A = c(t, D, P);
916
+ if (F) {
917
+ c(t, A, F);
918
918
  }
919
- if (O > 1) {
919
+ if (T > 1) {
920
920
  // at least one Token object was removed, so we have to do some rematching
921
921
  // this can only happen if the current pattern is greedy
922
922
  /** @type {RematchOptions} */
923
923
  var $ = {
924
924
  cause: d + "," + f,
925
- reach: D
925
+ reach: C
926
926
  };
927
- l(e, t, n, A.prev, T, $);
927
+ l(e, t, n, A.prev, k, $);
928
928
  // the reach might have been extended because of the rematching
929
929
  if (u && $.reach > u.reach) {
930
930
  u.reach = $.reach;
@@ -972,16 +972,16 @@
972
972
  * @template T
973
973
  */ function c(e, t, n) {
974
974
  // assumes that node != list.tail && values.length >= 0
975
- var a = t.next;
976
- var r = {
975
+ var r = t.next;
976
+ var a = {
977
977
  value: n,
978
978
  prev: t,
979
- next: a
979
+ next: r
980
980
  };
981
- t.next = r;
982
- a.prev = r;
981
+ t.next = a;
982
+ r.prev = a;
983
983
  e.length++;
984
- return r;
984
+ return a;
985
985
  }
986
986
  /**
987
987
  * Removes `count` nodes after the given node. The given node will not be removed.
@@ -991,13 +991,13 @@
991
991
  * @param {number} count
992
992
  * @template T
993
993
  */ function p(e, t, n) {
994
- var a = t.next;
995
- for (var r = 0; r < n && a !== e.tail; r++) {
996
- a = a.next;
994
+ var r = t.next;
995
+ for (var a = 0; a < n && r !== e.tail; a++) {
996
+ r = r.next;
997
997
  }
998
- t.next = a;
999
- a.prev = t;
1000
- e.length -= r;
998
+ t.next = r;
999
+ r.prev = t;
1000
+ e.length -= a;
1001
1001
  }
1002
1002
  /**
1003
1003
  * @param {LinkedList<T>} list
@@ -1015,37 +1015,37 @@
1015
1015
  if (!e.document) {
1016
1016
  if (!e.addEventListener) {
1017
1017
  // in Node.js
1018
- return i;
1018
+ return s;
1019
1019
  }
1020
- if (!i.disableWorkerMessageHandler) {
1020
+ if (!s.disableWorkerMessageHandler) {
1021
1021
  // In worker
1022
1022
  e.addEventListener("message", (function(t) {
1023
1023
  var n = JSON.parse(t.data);
1024
- var a = n.language;
1025
- var r = n.code;
1026
- var s = n.immediateClose;
1027
- e.postMessage(i.highlight(r, i.languages[a], a));
1028
- if (s) {
1024
+ var r = n.language;
1025
+ var a = n.code;
1026
+ var i = n.immediateClose;
1027
+ e.postMessage(s.highlight(a, s.languages[r], r));
1028
+ if (i) {
1029
1029
  e.close();
1030
1030
  }
1031
1031
  }), false);
1032
1032
  }
1033
- return i;
1033
+ return s;
1034
1034
  }
1035
1035
  // Get current script and highlight
1036
- var g = i.util.currentScript();
1036
+ var g = s.util.currentScript();
1037
1037
  if (g) {
1038
- i.filename = g.src;
1038
+ s.filename = g.src;
1039
1039
  if (g.hasAttribute("data-manual")) {
1040
- i.manual = true;
1040
+ s.manual = true;
1041
1041
  }
1042
1042
  }
1043
1043
  function f() {
1044
- if (!i.manual) {
1045
- i.highlightAll();
1044
+ if (!s.manual) {
1045
+ s.highlightAll();
1046
1046
  }
1047
1047
  }
1048
- if (!i.manual) {
1048
+ if (!s.manual) {
1049
1049
  // If the document state is "loading", then we'll use DOMContentLoaded.
1050
1050
  // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1051
1051
  // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
@@ -1063,14 +1063,14 @@
1063
1063
  }
1064
1064
  }
1065
1065
  }
1066
- return i;
1067
- }(a);
1066
+ return s;
1067
+ }(r);
1068
1068
  if (true && e.exports) {
1069
- e.exports = r;
1069
+ e.exports = a;
1070
1070
  }
1071
1071
  // hack for components to work correctly in node.js
1072
1072
  if (typeof n !== "undefined") {
1073
- n.Prism = r;
1073
+ n.Prism = a;
1074
1074
  }
1075
1075
  // some additional documentation/types
1076
1076
  /**
@@ -1117,7 +1117,7 @@
1117
1117
  * @public
1118
1118
  */
1119
1119
  // https://www.json.org/json-en.html
1120
- r.languages.json = {
1120
+ a.languages.json = {
1121
1121
  property: {
1122
1122
  pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
1123
1123
  lookbehind: true,
@@ -1141,8 +1141,8 @@
1141
1141
  alias: "keyword"
1142
1142
  }
1143
1143
  };
1144
- r.languages.webmanifest = r.languages.json;
1145
- r.languages.markup = {
1144
+ a.languages.webmanifest = a.languages.json;
1145
+ a.languages.markup = {
1146
1146
  comment: {
1147
1147
  pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1148
1148
  greedy: true
@@ -1213,15 +1213,15 @@
1213
1213
  alias: "named-entity"
1214
1214
  }, /&#x?[\da-f]{1,8};/i ]
1215
1215
  };
1216
- r.languages.markup["tag"].inside["attr-value"].inside["entity"] = r.languages.markup["entity"];
1217
- r.languages.markup["doctype"].inside["internal-subset"].inside = r.languages.markup;
1216
+ a.languages.markup["tag"].inside["attr-value"].inside["entity"] = a.languages.markup["entity"];
1217
+ a.languages.markup["doctype"].inside["internal-subset"].inside = a.languages.markup;
1218
1218
  // Plugin to make entity title show the real entity, idea by Roman Komarov
1219
- r.hooks.add("wrap", (function(e) {
1219
+ a.hooks.add("wrap", (function(e) {
1220
1220
  if (e.type === "entity") {
1221
1221
  e.attributes["title"] = e.content.replace(/&amp;/, "&");
1222
1222
  }
1223
1223
  }));
1224
- Object.defineProperty(r.languages.markup.tag, "addInlined", {
1224
+ Object.defineProperty(a.languages.markup.tag, "addInlined", {
1225
1225
  /**
1226
1226
  * Adds an inlined language to markup.
1227
1227
  *
@@ -1234,36 +1234,36 @@
1234
1234
  * addInlined('style', 'css');
1235
1235
  */
1236
1236
  value: function e(t, n) {
1237
- var a = {};
1238
- a["language-" + n] = {
1237
+ var r = {};
1238
+ r["language-" + n] = {
1239
1239
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1240
1240
  lookbehind: true,
1241
- inside: r.languages[n]
1241
+ inside: a.languages[n]
1242
1242
  };
1243
- a["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
1244
- var i = {
1243
+ r["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
1244
+ var s = {
1245
1245
  "included-cdata": {
1246
1246
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1247
- inside: a
1247
+ inside: r
1248
1248
  }
1249
1249
  };
1250
- i["language-" + n] = {
1250
+ s["language-" + n] = {
1251
1251
  pattern: /[\s\S]+/,
1252
- inside: r.languages[n]
1252
+ inside: a.languages[n]
1253
1253
  };
1254
- var s = {};
1255
- s[t] = {
1254
+ var i = {};
1255
+ i[t] = {
1256
1256
  pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, (function() {
1257
1257
  return t;
1258
1258
  })), "i"),
1259
1259
  lookbehind: true,
1260
1260
  greedy: true,
1261
- inside: i
1261
+ inside: s
1262
1262
  };
1263
- r.languages.insertBefore("markup", "cdata", s);
1263
+ a.languages.insertBefore("markup", "cdata", i);
1264
1264
  }
1265
1265
  });
1266
- Object.defineProperty(r.languages.markup.tag, "addAttribute", {
1266
+ Object.defineProperty(a.languages.markup.tag, "addAttribute", {
1267
1267
  /**
1268
1268
  * Adds an pattern to highlight languages embedded in HTML attributes.
1269
1269
  *
@@ -1276,7 +1276,7 @@
1276
1276
  * addAttribute('style', 'css');
1277
1277
  */
1278
1278
  value: function(e, t) {
1279
- r.languages.markup.tag.inside["special-attr"].push({
1279
+ a.languages.markup.tag.inside["special-attr"].push({
1280
1280
  pattern: RegExp(/(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"),
1281
1281
  lookbehind: true,
1282
1282
  inside: {
@@ -1288,7 +1288,7 @@
1288
1288
  pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1289
1289
  lookbehind: true,
1290
1290
  alias: [ t, "language-" + t ],
1291
- inside: r.languages[t]
1291
+ inside: a.languages[t]
1292
1292
  },
1293
1293
  punctuation: [ {
1294
1294
  pattern: /^=/,
@@ -1300,14 +1300,14 @@
1300
1300
  });
1301
1301
  }
1302
1302
  });
1303
- r.languages.html = r.languages.markup;
1304
- r.languages.mathml = r.languages.markup;
1305
- r.languages.svg = r.languages.markup;
1306
- r.languages.xml = r.languages.extend("markup", {});
1307
- r.languages.ssml = r.languages.xml;
1308
- r.languages.atom = r.languages.xml;
1309
- r.languages.rss = r.languages.xml;
1310
- r.languages.clike = {
1303
+ a.languages.html = a.languages.markup;
1304
+ a.languages.mathml = a.languages.markup;
1305
+ a.languages.svg = a.languages.markup;
1306
+ a.languages.xml = a.languages.extend("markup", {});
1307
+ a.languages.ssml = a.languages.xml;
1308
+ a.languages.atom = a.languages.xml;
1309
+ a.languages.rss = a.languages.xml;
1310
+ a.languages.clike = {
1311
1311
  comment: [ {
1312
1312
  pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1313
1313
  lookbehind: true,
@@ -1335,8 +1335,8 @@
1335
1335
  operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1336
1336
  punctuation: /[{}[\];(),.:]/
1337
1337
  };
1338
- r.languages.javascript = r.languages.extend("clike", {
1339
- "class-name": [ r.languages.clike["class-name"], {
1338
+ a.languages.javascript = a.languages.extend("clike", {
1339
+ "class-name": [ a.languages.clike["class-name"], {
1340
1340
  pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1341
1341
  lookbehind: true
1342
1342
  } ],
@@ -1367,8 +1367,8 @@
1367
1367
  },
1368
1368
  operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1369
1369
  });
1370
- r.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1371
- r.languages.insertBefore("javascript", "keyword", {
1370
+ a.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1371
+ a.languages.insertBefore("javascript", "keyword", {
1372
1372
  regex: {
1373
1373
  pattern: RegExp(
1374
1374
  // lookbehind
@@ -1390,7 +1390,7 @@
1390
1390
  pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1391
1391
  lookbehind: true,
1392
1392
  alias: "language-regex",
1393
- inside: r.languages.regex
1393
+ inside: a.languages.regex
1394
1394
  },
1395
1395
  "regex-delimiter": /^\/|\/$/,
1396
1396
  "regex-flags": /^[a-z]+$/
@@ -1404,23 +1404,23 @@
1404
1404
  parameter: [ {
1405
1405
  pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1406
1406
  lookbehind: true,
1407
- inside: r.languages.javascript
1407
+ inside: a.languages.javascript
1408
1408
  }, {
1409
1409
  pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1410
1410
  lookbehind: true,
1411
- inside: r.languages.javascript
1411
+ inside: a.languages.javascript
1412
1412
  }, {
1413
1413
  pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1414
1414
  lookbehind: true,
1415
- inside: r.languages.javascript
1415
+ inside: a.languages.javascript
1416
1416
  }, {
1417
1417
  pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1418
1418
  lookbehind: true,
1419
- inside: r.languages.javascript
1419
+ inside: a.languages.javascript
1420
1420
  } ],
1421
1421
  constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1422
1422
  });
1423
- r.languages.insertBefore("javascript", "string", {
1423
+ a.languages.insertBefore("javascript", "string", {
1424
1424
  hashbang: {
1425
1425
  pattern: /^#!.*/,
1426
1426
  greedy: true,
@@ -1442,7 +1442,7 @@
1442
1442
  pattern: /^\$\{|\}$/,
1443
1443
  alias: "punctuation"
1444
1444
  },
1445
- rest: r.languages.javascript
1445
+ rest: a.languages.javascript
1446
1446
  }
1447
1447
  },
1448
1448
  string: /[\s\S]+/
@@ -1455,55 +1455,55 @@
1455
1455
  alias: "property"
1456
1456
  }
1457
1457
  });
1458
- r.languages.insertBefore("javascript", "operator", {
1458
+ a.languages.insertBefore("javascript", "operator", {
1459
1459
  "literal-property": {
1460
1460
  pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1461
1461
  lookbehind: true,
1462
1462
  alias: "property"
1463
1463
  }
1464
1464
  });
1465
- if (r.languages.markup) {
1466
- r.languages.markup.tag.addInlined("script", "javascript");
1465
+ if (a.languages.markup) {
1466
+ a.languages.markup.tag.addInlined("script", "javascript");
1467
1467
  // add attribute support for all DOM events.
1468
1468
  // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1469
- r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript");
1469
+ a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript");
1470
1470
  }
1471
- r.languages.js = r.languages.javascript;
1471
+ a.languages.js = a.languages.javascript;
1472
1472
  (function(e) {
1473
1473
  var t = e.util.clone(e.languages.javascript);
1474
1474
  var n = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
1475
- var a = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
1476
- var r = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
1475
+ var r = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
1476
+ var a = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
1477
1477
  /**
1478
1478
  * @param {string} source
1479
1479
  * @param {string} [flags]
1480
- */ function i(e, t) {
1480
+ */ function s(e, t) {
1481
1481
  e = e.replace(/<S>/g, (function() {
1482
1482
  return n;
1483
1483
  })).replace(/<BRACES>/g, (function() {
1484
- return a;
1485
- })).replace(/<SPREAD>/g, (function() {
1486
1484
  return r;
1485
+ })).replace(/<SPREAD>/g, (function() {
1486
+ return a;
1487
1487
  }));
1488
1488
  return RegExp(e, t);
1489
1489
  }
1490
- r = i(r).source;
1490
+ a = s(a).source;
1491
1491
  e.languages.jsx = e.languages.extend("markup", t);
1492
- e.languages.jsx.tag.pattern = i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source);
1492
+ e.languages.jsx.tag.pattern = s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source);
1493
1493
  e.languages.jsx.tag.inside["tag"].pattern = /^<\/?[^\s>\/]*/;
1494
1494
  e.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
1495
1495
  e.languages.jsx.tag.inside["tag"].inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
1496
1496
  e.languages.jsx.tag.inside["comment"] = t["comment"];
1497
1497
  e.languages.insertBefore("inside", "attr-name", {
1498
1498
  spread: {
1499
- pattern: i(/<SPREAD>/.source),
1499
+ pattern: s(/<SPREAD>/.source),
1500
1500
  inside: e.languages.jsx
1501
1501
  }
1502
1502
  }, e.languages.jsx.tag);
1503
1503
  e.languages.insertBefore("inside", "special-attr", {
1504
1504
  script: {
1505
1505
  // Allow for two levels of nesting
1506
- pattern: i(/=<BRACES>/.source),
1506
+ pattern: s(/=<BRACES>/.source),
1507
1507
  alias: "language-javascript",
1508
1508
  inside: {
1509
1509
  "script-punctuation": {
@@ -1515,7 +1515,7 @@
1515
1515
  }
1516
1516
  }, e.languages.jsx.tag);
1517
1517
  // The following will handle plain text inside tags
1518
- var s = function(e) {
1518
+ var i = function(e) {
1519
1519
  if (!e) {
1520
1520
  return "";
1521
1521
  }
@@ -1525,63 +1525,63 @@
1525
1525
  if (typeof e.content === "string") {
1526
1526
  return e.content;
1527
1527
  }
1528
- return e.content.map(s).join("");
1528
+ return e.content.map(i).join("");
1529
1529
  };
1530
1530
  var o = function(t) {
1531
1531
  var n = [];
1532
- for (var a = 0; a < t.length; a++) {
1533
- var r = t[a];
1534
- var i = false;
1535
- if (typeof r !== "string") {
1536
- if (r.type === "tag" && r.content[0] && r.content[0].type === "tag") {
1532
+ for (var r = 0; r < t.length; r++) {
1533
+ var a = t[r];
1534
+ var s = false;
1535
+ if (typeof a !== "string") {
1536
+ if (a.type === "tag" && a.content[0] && a.content[0].type === "tag") {
1537
1537
  // We found a tag, now find its kind
1538
- if (r.content[0].content[0].content === "</") {
1538
+ if (a.content[0].content[0].content === "</") {
1539
1539
  // Closing tag
1540
- if (n.length > 0 && n[n.length - 1].tagName === s(r.content[0].content[1])) {
1540
+ if (n.length > 0 && n[n.length - 1].tagName === i(a.content[0].content[1])) {
1541
1541
  // Pop matching opening tag
1542
1542
  n.pop();
1543
1543
  }
1544
1544
  } else {
1545
- if (r.content[r.content.length - 1].content === "/>") {
1545
+ if (a.content[a.content.length - 1].content === "/>") {
1546
1546
  // Autoclosed tag, ignore
1547
1547
  } else {
1548
1548
  // Opening tag
1549
1549
  n.push({
1550
- tagName: s(r.content[0].content[1]),
1550
+ tagName: i(a.content[0].content[1]),
1551
1551
  openedBraces: 0
1552
1552
  });
1553
1553
  }
1554
1554
  }
1555
- } else if (n.length > 0 && r.type === "punctuation" && r.content === "{") {
1555
+ } else if (n.length > 0 && a.type === "punctuation" && a.content === "{") {
1556
1556
  // Here we might have entered a JSX context inside a tag
1557
1557
  n[n.length - 1].openedBraces++;
1558
- } else if (n.length > 0 && n[n.length - 1].openedBraces > 0 && r.type === "punctuation" && r.content === "}") {
1558
+ } else if (n.length > 0 && n[n.length - 1].openedBraces > 0 && a.type === "punctuation" && a.content === "}") {
1559
1559
  // Here we might have left a JSX context inside a tag
1560
1560
  n[n.length - 1].openedBraces--;
1561
1561
  } else {
1562
- i = true;
1562
+ s = true;
1563
1563
  }
1564
1564
  }
1565
- if (i || typeof r === "string") {
1565
+ if (s || typeof a === "string") {
1566
1566
  if (n.length > 0 && n[n.length - 1].openedBraces === 0) {
1567
1567
  // Here we are inside a tag, and not inside a JSX context.
1568
1568
  // That's plain text: drop any tokens matched.
1569
- var l = s(r);
1569
+ var l = i(a);
1570
1570
  // And merge text with adjacent text
1571
- if (a < t.length - 1 && (typeof t[a + 1] === "string" || t[a + 1].type === "plain-text")) {
1572
- l += s(t[a + 1]);
1573
- t.splice(a + 1, 1);
1571
+ if (r < t.length - 1 && (typeof t[r + 1] === "string" || t[r + 1].type === "plain-text")) {
1572
+ l += i(t[r + 1]);
1573
+ t.splice(r + 1, 1);
1574
1574
  }
1575
- if (a > 0 && (typeof t[a - 1] === "string" || t[a - 1].type === "plain-text")) {
1576
- l = s(t[a - 1]) + l;
1577
- t.splice(a - 1, 1);
1578
- a--;
1575
+ if (r > 0 && (typeof t[r - 1] === "string" || t[r - 1].type === "plain-text")) {
1576
+ l = i(t[r - 1]) + l;
1577
+ t.splice(r - 1, 1);
1578
+ r--;
1579
1579
  }
1580
- t[a] = new e.Token("plain-text", l, null, l);
1580
+ t[r] = new e.Token("plain-text", l, null, l);
1581
1581
  }
1582
1582
  }
1583
- if (r.content && typeof r.content !== "string") {
1584
- o(r.content);
1583
+ if (a.content && typeof a.content !== "string") {
1584
+ o(a.content);
1585
1585
  }
1586
1586
  }
1587
1587
  };
@@ -1591,7 +1591,7 @@
1591
1591
  }
1592
1592
  o(e.tokens);
1593
1593
  }));
1594
- })(r);
1594
+ })(a);
1595
1595
  (function(e) {
1596
1596
  e.languages.typescript = e.languages.extend("javascript", {
1597
1597
  "class-name": {
@@ -1642,7 +1642,7 @@
1642
1642
  }
1643
1643
  });
1644
1644
  e.languages.ts = e.languages.typescript;
1645
- })(r);
1645
+ })(a);
1646
1646
  (function(e) {
1647
1647
  var t = e.util.clone(e.languages.typescript);
1648
1648
  e.languages.tsx = e.languages.extend("jsx", t);
@@ -1655,7 +1655,7 @@
1655
1655
  var n = e.languages.tsx.tag;
1656
1656
  n.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + "(?:" + n.pattern.source + ")", n.pattern.flags);
1657
1657
  n.lookbehind = true;
1658
- })(r);
1658
+ })(a);
1659
1659
  (function(e) {
1660
1660
  var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1661
1661
  e.languages.css = {
@@ -1713,7 +1713,7 @@
1713
1713
  n.tag.addInlined("style", "css");
1714
1714
  n.tag.addAttribute("style", "css");
1715
1715
  }
1716
- })(r);
1716
+ })(a);
1717
1717
  (function(e) {
1718
1718
  // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
1719
1719
  // + LC_ALL, RANDOM, REPLY, SECONDS.
@@ -1727,7 +1727,7 @@
1727
1727
  // this looks reasonably well in all themes
1728
1728
  inside: null
1729
1729
  };
1730
- var a = {
1730
+ var r = {
1731
1731
  bash: n,
1732
1732
  environment: {
1733
1733
  pattern: RegExp("\\$" + t),
@@ -1832,7 +1832,7 @@
1832
1832
  pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
1833
1833
  lookbehind: true,
1834
1834
  greedy: true,
1835
- inside: a
1835
+ inside: r
1836
1836
  },
1837
1837
  // Here-document with quotes around the tag
1838
1838
  // → No expansion (so no “inside”).
@@ -1850,7 +1850,7 @@
1850
1850
  pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
1851
1851
  lookbehind: true,
1852
1852
  greedy: true,
1853
- inside: a
1853
+ inside: r
1854
1854
  }, {
1855
1855
  // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
1856
1856
  pattern: /(^|[^$\\])'[^']*'/,
@@ -1861,14 +1861,14 @@
1861
1861
  pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
1862
1862
  greedy: true,
1863
1863
  inside: {
1864
- entity: a.entity
1864
+ entity: r.entity
1865
1865
  }
1866
1866
  } ],
1867
1867
  environment: {
1868
1868
  pattern: RegExp("\\$?" + t),
1869
1869
  alias: "constant"
1870
1870
  },
1871
- variable: a.variable,
1871
+ variable: r.variable,
1872
1872
  function: {
1873
1873
  pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
1874
1874
  lookbehind: true
@@ -1909,14 +1909,14 @@
1909
1909
  }
1910
1910
  };
1911
1911
  n.inside = e.languages.bash;
1912
- /* Patterns in command substitution. */ var r = [ "comment", "function-name", "for-or-select", "assign-left", "parameter", "string", "environment", "function", "keyword", "builtin", "boolean", "file-descriptor", "operator", "punctuation", "number" ];
1913
- var i = a.variable[1].inside;
1914
- for (var s = 0; s < r.length; s++) {
1915
- i[r[s]] = e.languages.bash[r[s]];
1912
+ /* Patterns in command substitution. */ var a = [ "comment", "function-name", "for-or-select", "assign-left", "parameter", "string", "environment", "function", "keyword", "builtin", "boolean", "file-descriptor", "operator", "punctuation", "number" ];
1913
+ var s = r.variable[1].inside;
1914
+ for (var i = 0; i < a.length; i++) {
1915
+ s[a[i]] = e.languages.bash[a[i]];
1916
1916
  }
1917
1917
  e.languages.sh = e.languages.bash;
1918
1918
  e.languages.shell = e.languages.bash;
1919
- })(r);
1919
+ })(a);
1920
1920
  (function(e) {
1921
1921
  // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
1922
1922
  // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
@@ -1924,24 +1924,24 @@
1924
1924
  // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
1925
1925
  var n = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
1926
1926
  // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
1927
- var a = "(?:" + n.source + "(?:[ \t]+" + t.source + ")?|" + t.source + "(?:[ \t]+" + n.source + ")?)";
1927
+ var r = "(?:" + n.source + "(?:[ \t]+" + t.source + ")?|" + t.source + "(?:[ \t]+" + n.source + ")?)";
1928
1928
  // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
1929
1929
  // This is a simplified version that doesn't support "#" and multiline keys
1930
1930
  // All these long scarry character classes are simplified versions of YAML's characters
1931
- var r = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, (function() {
1931
+ var a = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, (function() {
1932
1932
  return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
1933
1933
  }));
1934
- var i = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
1934
+ var s = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
1935
1935
  /**
1936
1936
  *
1937
1937
  * @param {string} value
1938
1938
  * @param {string} [flags]
1939
1939
  * @returns {RegExp}
1940
- */ function s(e, t) {
1940
+ */ function i(e, t) {
1941
1941
  t = (t || "").replace(/m/g, "") + "m";
1942
1942
  // add m flag
1943
1943
  var n = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, (function() {
1944
- return a;
1944
+ return r;
1945
1945
  })).replace(/<<value>>/g, (function() {
1946
1946
  return e;
1947
1947
  }));
@@ -1950,7 +1950,7 @@
1950
1950
  e.languages.yaml = {
1951
1951
  scalar: {
1952
1952
  pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, (function() {
1953
- return a;
1953
+ return r;
1954
1954
  }))),
1955
1955
  lookbehind: true,
1956
1956
  alias: "string"
@@ -1958,9 +1958,9 @@
1958
1958
  comment: /#.*/,
1959
1959
  key: {
1960
1960
  pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, (function() {
1961
- return a;
1961
+ return r;
1962
1962
  })).replace(/<<key>>/g, (function() {
1963
- return "(?:" + r + "|" + i + ")";
1963
+ return "(?:" + a + "|" + s + ")";
1964
1964
  }))),
1965
1965
  lookbehind: true,
1966
1966
  greedy: true,
@@ -1972,27 +1972,27 @@
1972
1972
  alias: "important"
1973
1973
  },
1974
1974
  datetime: {
1975
- pattern: s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
1975
+ pattern: i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
1976
1976
  lookbehind: true,
1977
1977
  alias: "number"
1978
1978
  },
1979
1979
  boolean: {
1980
- pattern: s(/false|true/.source, "i"),
1980
+ pattern: i(/false|true/.source, "i"),
1981
1981
  lookbehind: true,
1982
1982
  alias: "important"
1983
1983
  },
1984
1984
  null: {
1985
- pattern: s(/null|~/.source, "i"),
1985
+ pattern: i(/null|~/.source, "i"),
1986
1986
  lookbehind: true,
1987
1987
  alias: "important"
1988
1988
  },
1989
1989
  string: {
1990
- pattern: s(i),
1990
+ pattern: i(s),
1991
1991
  lookbehind: true,
1992
1992
  greedy: true
1993
1993
  },
1994
1994
  number: {
1995
- pattern: s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
1995
+ pattern: i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
1996
1996
  lookbehind: true
1997
1997
  },
1998
1998
  tag: n,
@@ -2000,8 +2000,8 @@
2000
2000
  punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
2001
2001
  };
2002
2002
  e.languages.yml = e.languages.yaml;
2003
- })(r);
2004
- r.languages["splunk-spl"] = {
2003
+ })(a);
2004
+ a.languages["splunk-spl"] = {
2005
2005
  comment: /`comment\("(?:\\.|[^\\"])*"\)`/,
2006
2006
  string: {
2007
2007
  pattern: /"(?:\\.|[^\\"])*"/,
@@ -2025,7 +2025,7 @@
2025
2025
  operator: /[<>=]=?|[-+*/%|]/,
2026
2026
  punctuation: /[()[\],]/
2027
2027
  };
2028
- r.languages.sql = {
2028
+ a.languages.sql = {
2029
2029
  comment: {
2030
2030
  pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
2031
2031
  lookbehind: true
@@ -2055,6 +2055,603 @@
2055
2055
  operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
2056
2056
  punctuation: /[;[\]()`,.]/
2057
2057
  };
2058
+ a.languages.c = a.languages.extend("clike", {
2059
+ comment: {
2060
+ pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
2061
+ greedy: true
2062
+ },
2063
+ string: {
2064
+ // https://en.cppreference.com/w/c/language/string_literal
2065
+ pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
2066
+ greedy: true
2067
+ },
2068
+ "class-name": {
2069
+ pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
2070
+ lookbehind: true
2071
+ },
2072
+ keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
2073
+ function: /\b[a-z_]\w*(?=\s*\()/i,
2074
+ number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
2075
+ operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
2076
+ });
2077
+ a.languages.insertBefore("c", "string", {
2078
+ char: {
2079
+ // https://en.cppreference.com/w/c/language/character_constant
2080
+ pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
2081
+ greedy: true
2082
+ }
2083
+ });
2084
+ a.languages.insertBefore("c", "string", {
2085
+ macro: {
2086
+ // allow for multiline macro definitions
2087
+ // spaces after the # character compile fine with gcc
2088
+ pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
2089
+ lookbehind: true,
2090
+ greedy: true,
2091
+ alias: "property",
2092
+ inside: {
2093
+ string: [ {
2094
+ // highlight the path of the include statement as a string
2095
+ pattern: /^(#\s*include\s*)<[^>]+>/,
2096
+ lookbehind: true
2097
+ }, a.languages.c["string"] ],
2098
+ char: a.languages.c["char"],
2099
+ comment: a.languages.c["comment"],
2100
+ "macro-name": [ {
2101
+ pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
2102
+ lookbehind: true
2103
+ }, {
2104
+ pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
2105
+ lookbehind: true,
2106
+ alias: "function"
2107
+ } ],
2108
+ // highlight macro directives as keywords
2109
+ directive: {
2110
+ pattern: /^(#\s*)[a-z]+/,
2111
+ lookbehind: true,
2112
+ alias: "keyword"
2113
+ },
2114
+ "directive-hash": /^#/,
2115
+ punctuation: /##|\\(?=[\r\n])/,
2116
+ expression: {
2117
+ pattern: /\S[\s\S]*/,
2118
+ inside: a.languages.c
2119
+ }
2120
+ }
2121
+ }
2122
+ });
2123
+ a.languages.insertBefore("c", "function", {
2124
+ // highlight predefined macros as constants
2125
+ constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
2126
+ });
2127
+ delete a.languages.c["boolean"];
2128
+ (function(e) {
2129
+ var t = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
2130
+ var n = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, (function() {
2131
+ return t.source;
2132
+ }));
2133
+ e.languages.cpp = e.languages.extend("c", {
2134
+ "class-name": [ {
2135
+ pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, (function() {
2136
+ return t.source;
2137
+ }))),
2138
+ lookbehind: true
2139
+ },
2140
+ // This is intended to capture the class name of method implementations like:
2141
+ // void foo::bar() const {}
2142
+ // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
2143
+ // it starts with an uppercase letter. This approximation should give decent results.
2144
+ /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
2145
+ // This will capture the class name before destructors like:
2146
+ // Foo::~Foo() {}
2147
+ /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
2148
+ // This also intends to capture the class name of method implementations but here the class has template
2149
+ // parameters, so it can't be a namespace (until C++ adds generic namespaces).
2150
+ /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/ ],
2151
+ keyword: t,
2152
+ number: {
2153
+ pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
2154
+ greedy: true
2155
+ },
2156
+ operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
2157
+ boolean: /\b(?:false|true)\b/
2158
+ });
2159
+ e.languages.insertBefore("cpp", "string", {
2160
+ module: {
2161
+ // https://en.cppreference.com/w/cpp/language/modules
2162
+ pattern: RegExp(/(\b(?:import|module)\s+)/.source + "(?:" +
2163
+ // header-name
2164
+ /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" +
2165
+ // module name or partition or both
2166
+ /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, (function() {
2167
+ return n;
2168
+ })) + ")"),
2169
+ lookbehind: true,
2170
+ greedy: true,
2171
+ inside: {
2172
+ string: /^[<"][\s\S]+/,
2173
+ operator: /:/,
2174
+ punctuation: /\./
2175
+ }
2176
+ },
2177
+ "raw-string": {
2178
+ pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
2179
+ alias: "string",
2180
+ greedy: true
2181
+ }
2182
+ });
2183
+ e.languages.insertBefore("cpp", "keyword", {
2184
+ "generic-function": {
2185
+ pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
2186
+ inside: {
2187
+ function: /^\w+/,
2188
+ generic: {
2189
+ pattern: /<[\s\S]+/,
2190
+ alias: "class-name",
2191
+ inside: e.languages.cpp
2192
+ }
2193
+ }
2194
+ }
2195
+ });
2196
+ e.languages.insertBefore("cpp", "operator", {
2197
+ "double-colon": {
2198
+ pattern: /::/,
2199
+ alias: "punctuation"
2200
+ }
2201
+ });
2202
+ e.languages.insertBefore("cpp", "class-name", {
2203
+ // the base clause is an optional list of parent classes
2204
+ // https://en.cppreference.com/w/cpp/language/class
2205
+ "base-clause": {
2206
+ pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
2207
+ lookbehind: true,
2208
+ greedy: true,
2209
+ inside: e.languages.extend("cpp", {})
2210
+ }
2211
+ });
2212
+ e.languages.insertBefore("inside", "double-colon", {
2213
+ // All untokenized words that are not namespaces should be class names
2214
+ "class-name": /\b[a-z_]\w*\b(?!\s*::)/i
2215
+ }, e.languages.cpp["base-clause"]);
2216
+ })(a);
2217
+ (function(e) {
2218
+ /**
2219
+ * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
2220
+ *
2221
+ * Note: This is a simple text based replacement. Be careful when using backreferences!
2222
+ *
2223
+ * @param {string} pattern the given pattern.
2224
+ * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
2225
+ * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
2226
+ * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
2227
+ */
2228
+ function t(e, t) {
2229
+ return e.replace(/<<(\d+)>>/g, (function(e, n) {
2230
+ return "(?:" + t[+n] + ")";
2231
+ }));
2232
+ }
2233
+ /**
2234
+ * @param {string} pattern
2235
+ * @param {string[]} replacements
2236
+ * @param {string} [flags]
2237
+ * @returns {RegExp}
2238
+ */ function n(e, n, r) {
2239
+ return RegExp(t(e, n), r || "");
2240
+ }
2241
+ /**
2242
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
2243
+ *
2244
+ * @param {string} pattern
2245
+ * @param {number} depthLog2
2246
+ * @returns {string}
2247
+ */ function r(e, t) {
2248
+ for (var n = 0; n < t; n++) {
2249
+ e = e.replace(/<<self>>/g, (function() {
2250
+ return "(?:" + e + ")";
2251
+ }));
2252
+ }
2253
+ return e.replace(/<<self>>/g, "[^\\s\\S]");
2254
+ }
2255
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
2256
+ var a = {
2257
+ // keywords which represent a return or variable type
2258
+ type: "bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",
2259
+ // keywords which are used to declare a type
2260
+ typeDeclaration: "class enum interface record struct",
2261
+ // contextual keywords
2262
+ // ("var" and "dynamic" are missing because they are used like types)
2263
+ contextual: "add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",
2264
+ // all other keywords
2265
+ other: "abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"
2266
+ };
2267
+ // keywords
2268
+ function s(e) {
2269
+ return "\\b(?:" + e.trim().replace(/ /g, "|") + ")\\b";
2270
+ }
2271
+ var i = s(a.typeDeclaration);
2272
+ var o = RegExp(s(a.type + " " + a.typeDeclaration + " " + a.contextual + " " + a.other));
2273
+ var l = s(a.typeDeclaration + " " + a.contextual + " " + a.other);
2274
+ var u = s(a.type + " " + a.typeDeclaration + " " + a.other);
2275
+ // types
2276
+ var c = r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2);
2277
+ // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
2278
+ var p = r(/\((?:[^()]|<<self>>)*\)/.source, 2);
2279
+ var d = /@?\b[A-Za-z_]\w*\b/.source;
2280
+ var g = t(/<<0>>(?:\s*<<1>>)?/.source, [ d, c ]);
2281
+ var f = t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [ l, g ]);
2282
+ var m = /\[\s*(?:,\s*)*\]/.source;
2283
+ var b = t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [ f, m ]);
2284
+ var h = t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [ c, p, m ]);
2285
+ var v = t(/\(<<0>>+(?:,<<0>>+)+\)/.source, [ h ]);
2286
+ var E = t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ v, f, m ]);
2287
+ var y = {
2288
+ keyword: o,
2289
+ punctuation: /[<>()?,.:[\]]/
2290
+ };
2291
+ // strings & characters
2292
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
2293
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
2294
+ var S = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source;
2295
+ // simplified pattern
2296
+ var A = /"(?:\\.|[^\\"\r\n])*"/.source;
2297
+ var k = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
2298
+ e.languages.csharp = e.languages.extend("clike", {
2299
+ string: [ {
2300
+ pattern: n(/(^|[^$\\])<<0>>/.source, [ k ]),
2301
+ lookbehind: true,
2302
+ greedy: true
2303
+ }, {
2304
+ pattern: n(/(^|[^@$\\])<<0>>/.source, [ A ]),
2305
+ lookbehind: true,
2306
+ greedy: true
2307
+ } ],
2308
+ "class-name": [ {
2309
+ // Using static
2310
+ // using static System.Math;
2311
+ pattern: n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [ f ]),
2312
+ lookbehind: true,
2313
+ inside: y
2314
+ }, {
2315
+ // Using alias (type)
2316
+ // using Project = PC.MyCompany.Project;
2317
+ pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ d, E ]),
2318
+ lookbehind: true,
2319
+ inside: y
2320
+ }, {
2321
+ // Using alias (alias)
2322
+ // using Project = PC.MyCompany.Project;
2323
+ pattern: n(/(\busing\s+)<<0>>(?=\s*=)/.source, [ d ]),
2324
+ lookbehind: true
2325
+ }, {
2326
+ // Type declarations
2327
+ // class Foo<A, B>
2328
+ // interface Foo<out A, B>
2329
+ pattern: n(/(\b<<0>>\s+)<<1>>/.source, [ i, g ]),
2330
+ lookbehind: true,
2331
+ inside: y
2332
+ }, {
2333
+ // Single catch exception declaration
2334
+ // catch(Foo)
2335
+ // (things like catch(Foo e) is covered by variable declaration)
2336
+ pattern: n(/(\bcatch\s*\(\s*)<<0>>/.source, [ f ]),
2337
+ lookbehind: true,
2338
+ inside: y
2339
+ }, {
2340
+ // Name of the type parameter of generic constraints
2341
+ // where Foo : class
2342
+ pattern: n(/(\bwhere\s+)<<0>>/.source, [ d ]),
2343
+ lookbehind: true
2344
+ }, {
2345
+ // Casts and checks via as and is.
2346
+ // as Foo<A>, is Bar<B>
2347
+ // (things like if(a is Foo b) is covered by variable declaration)
2348
+ pattern: n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [ b ]),
2349
+ lookbehind: true,
2350
+ inside: y
2351
+ }, {
2352
+ // Variable, field and parameter declaration
2353
+ // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
2354
+ pattern: n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ E, u, d ]),
2355
+ inside: y
2356
+ } ],
2357
+ keyword: o,
2358
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
2359
+ number: /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
2360
+ operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
2361
+ punctuation: /\?\.?|::|[{}[\];(),.:]/
2362
+ });
2363
+ e.languages.insertBefore("csharp", "number", {
2364
+ range: {
2365
+ pattern: /\.\./,
2366
+ alias: "operator"
2367
+ }
2368
+ });
2369
+ e.languages.insertBefore("csharp", "punctuation", {
2370
+ "named-parameter": {
2371
+ pattern: n(/([(,]\s*)<<0>>(?=\s*:)/.source, [ d ]),
2372
+ lookbehind: true,
2373
+ alias: "punctuation"
2374
+ }
2375
+ });
2376
+ e.languages.insertBefore("csharp", "class-name", {
2377
+ namespace: {
2378
+ // namespace Foo.Bar {}
2379
+ // using Foo.Bar;
2380
+ pattern: n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [ d ]),
2381
+ lookbehind: true,
2382
+ inside: {
2383
+ punctuation: /\./
2384
+ }
2385
+ },
2386
+ "type-expression": {
2387
+ // default(Foo), typeof(Foo<Bar>), sizeof(int)
2388
+ pattern: n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [ p ]),
2389
+ lookbehind: true,
2390
+ alias: "class-name",
2391
+ inside: y
2392
+ },
2393
+ "return-type": {
2394
+ // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
2395
+ // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
2396
+ // int Foo => 0; int Foo { get; set } = 0;
2397
+ pattern: n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ E, f ]),
2398
+ inside: y,
2399
+ alias: "class-name"
2400
+ },
2401
+ "constructor-invocation": {
2402
+ // new List<Foo<Bar[]>> { }
2403
+ pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [ E ]),
2404
+ lookbehind: true,
2405
+ inside: y,
2406
+ alias: "class-name"
2407
+ },
2408
+ /*'explicit-implementation': {
2409
+ // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
2410
+ pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
2411
+ inside: classNameInside,
2412
+ alias: 'class-name'
2413
+ },*/
2414
+ "generic-method": {
2415
+ // foo<Bar>()
2416
+ pattern: n(/<<0>>\s*<<1>>(?=\s*\()/.source, [ d, c ]),
2417
+ inside: {
2418
+ function: n(/^<<0>>/.source, [ d ]),
2419
+ generic: {
2420
+ pattern: RegExp(c),
2421
+ alias: "class-name",
2422
+ inside: y
2423
+ }
2424
+ }
2425
+ },
2426
+ "type-list": {
2427
+ // The list of types inherited or of generic constraints
2428
+ // class Foo<F> : Bar, IList<FooBar>
2429
+ // where F : Bar, IList<int>
2430
+ pattern: n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ i, g, d, E, o.source, p, /\bnew\s*\(\s*\)/.source ]),
2431
+ lookbehind: true,
2432
+ inside: {
2433
+ "record-arguments": {
2434
+ pattern: n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [ g, p ]),
2435
+ lookbehind: true,
2436
+ greedy: true,
2437
+ inside: e.languages.csharp
2438
+ },
2439
+ keyword: o,
2440
+ "class-name": {
2441
+ pattern: RegExp(E),
2442
+ greedy: true,
2443
+ inside: y
2444
+ },
2445
+ punctuation: /[,()]/
2446
+ }
2447
+ },
2448
+ preprocessor: {
2449
+ pattern: /(^[\t ]*)#.*/m,
2450
+ lookbehind: true,
2451
+ alias: "property",
2452
+ inside: {
2453
+ // highlight preprocessor directives as keywords
2454
+ directive: {
2455
+ pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
2456
+ lookbehind: true,
2457
+ alias: "keyword"
2458
+ }
2459
+ }
2460
+ }
2461
+ });
2462
+ // attributes
2463
+ var x = A + "|" + S;
2464
+ var T = t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [ x ]);
2465
+ var I = r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [ T ]), 2);
2466
+ // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
2467
+ var R = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
2468
+ var w = t(/<<0>>(?:\s*\(<<1>>*\))?/.source, [ f, I ]);
2469
+ e.languages.insertBefore("csharp", "class-name", {
2470
+ attribute: {
2471
+ // Attributes
2472
+ // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
2473
+ pattern: n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [ R, w ]),
2474
+ lookbehind: true,
2475
+ greedy: true,
2476
+ inside: {
2477
+ target: {
2478
+ pattern: n(/^<<0>>(?=\s*:)/.source, [ R ]),
2479
+ alias: "keyword"
2480
+ },
2481
+ "attribute-arguments": {
2482
+ pattern: n(/\(<<0>>*\)/.source, [ I ]),
2483
+ inside: e.languages.csharp
2484
+ },
2485
+ "class-name": {
2486
+ pattern: RegExp(f),
2487
+ inside: {
2488
+ punctuation: /\./
2489
+ }
2490
+ },
2491
+ punctuation: /[:,]/
2492
+ }
2493
+ }
2494
+ });
2495
+ // string interpolation
2496
+ var N = /:[^}\r\n]+/.source;
2497
+ // multi line
2498
+ var O = r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [ T ]), 2);
2499
+ var _ = t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ O, N ]);
2500
+ // single line
2501
+ var L = r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [ x ]), 2);
2502
+ var F = t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ L, N ]);
2503
+ function C(t, r) {
2504
+ return {
2505
+ interpolation: {
2506
+ pattern: n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [ t ]),
2507
+ lookbehind: true,
2508
+ inside: {
2509
+ "format-string": {
2510
+ pattern: n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [ r, N ]),
2511
+ lookbehind: true,
2512
+ inside: {
2513
+ punctuation: /^:/
2514
+ }
2515
+ },
2516
+ punctuation: /^\{|\}$/,
2517
+ expression: {
2518
+ pattern: /[\s\S]+/,
2519
+ alias: "language-csharp",
2520
+ inside: e.languages.csharp
2521
+ }
2522
+ }
2523
+ },
2524
+ string: /[\s\S]+/
2525
+ };
2526
+ }
2527
+ e.languages.insertBefore("csharp", "string", {
2528
+ "interpolation-string": [ {
2529
+ pattern: n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [ _ ]),
2530
+ lookbehind: true,
2531
+ greedy: true,
2532
+ inside: C(_, O)
2533
+ }, {
2534
+ pattern: n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [ F ]),
2535
+ lookbehind: true,
2536
+ greedy: true,
2537
+ inside: C(F, L)
2538
+ } ],
2539
+ char: {
2540
+ pattern: RegExp(S),
2541
+ greedy: true
2542
+ }
2543
+ });
2544
+ e.languages.dotnet = e.languages.cs = e.languages.csharp;
2545
+ })(a);
2546
+ (function(e) {
2547
+ var t = e.languages.powershell = {
2548
+ comment: [ {
2549
+ pattern: /(^|[^`])<#[\s\S]*?#>/,
2550
+ lookbehind: true
2551
+ }, {
2552
+ pattern: /(^|[^`])#.*/,
2553
+ lookbehind: true
2554
+ } ],
2555
+ string: [ {
2556
+ pattern: /"(?:`[\s\S]|[^`"])*"/,
2557
+ greedy: true,
2558
+ inside: null
2559
+ }, {
2560
+ pattern: /'(?:[^']|'')*'/,
2561
+ greedy: true
2562
+ } ],
2563
+ // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
2564
+ // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)
2565
+ namespace: /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,
2566
+ boolean: /\$(?:false|true)\b/i,
2567
+ variable: /\$\w+\b/,
2568
+ // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
2569
+ // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
2570
+ // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
2571
+ function: [ /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i, /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i ],
2572
+ // per http://technet.microsoft.com/en-us/library/hh847744.aspx
2573
+ keyword: /\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,
2574
+ operator: {
2575
+ pattern: /(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,
2576
+ lookbehind: true
2577
+ },
2578
+ punctuation: /[|{}[\];(),.]/
2579
+ };
2580
+ // Variable interpolation inside strings, and nested expressions
2581
+ t.string[0].inside = {
2582
+ function: {
2583
+ // Allow for one level of nesting
2584
+ pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,
2585
+ lookbehind: true,
2586
+ inside: t
2587
+ },
2588
+ boolean: t.boolean,
2589
+ variable: t.variable
2590
+ };
2591
+ })(a);
2592
+ a.languages.python = {
2593
+ comment: {
2594
+ pattern: /(^|[^\\])#.*/,
2595
+ lookbehind: true,
2596
+ greedy: true
2597
+ },
2598
+ "string-interpolation": {
2599
+ pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
2600
+ greedy: true,
2601
+ inside: {
2602
+ interpolation: {
2603
+ // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
2604
+ pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
2605
+ lookbehind: true,
2606
+ inside: {
2607
+ "format-spec": {
2608
+ pattern: /(:)[^:(){}]+(?=\}$)/,
2609
+ lookbehind: true
2610
+ },
2611
+ "conversion-option": {
2612
+ pattern: /![sra](?=[:}]$)/,
2613
+ alias: "punctuation"
2614
+ },
2615
+ rest: null
2616
+ }
2617
+ },
2618
+ string: /[\s\S]+/
2619
+ }
2620
+ },
2621
+ "triple-quoted-string": {
2622
+ pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
2623
+ greedy: true,
2624
+ alias: "string"
2625
+ },
2626
+ string: {
2627
+ pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2628
+ greedy: true
2629
+ },
2630
+ function: {
2631
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
2632
+ lookbehind: true
2633
+ },
2634
+ "class-name": {
2635
+ pattern: /(\bclass\s+)\w+/i,
2636
+ lookbehind: true
2637
+ },
2638
+ decorator: {
2639
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
2640
+ lookbehind: true,
2641
+ alias: [ "annotation", "punctuation" ],
2642
+ inside: {
2643
+ punctuation: /\./
2644
+ }
2645
+ },
2646
+ keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2647
+ builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2648
+ boolean: /\b(?:False|None|True)\b/,
2649
+ number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2650
+ operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2651
+ punctuation: /[{}[\];(),.:]/
2652
+ };
2653
+ a.languages.python["string-interpolation"].inside["interpolation"].inside.rest = a.languages.python;
2654
+ a.languages.py = a.languages.python;
2058
2655
  })();
2059
2656
  /***/
2060
2657
  /******/ }
@@ -2064,24 +2661,24 @@
2064
2661
  /******/ var t = {};
2065
2662
  /******/
2066
2663
  /******/ // The require function
2067
- /******/ function n(a) {
2664
+ /******/ function n(r) {
2068
2665
  /******/ // Check if module is in cache
2069
- /******/ var r = t[a];
2070
- /******/ if (r !== undefined) {
2071
- /******/ return r.exports;
2666
+ /******/ var a = t[r];
2667
+ /******/ if (a !== undefined) {
2668
+ /******/ return a.exports;
2072
2669
  /******/ }
2073
2670
  /******/ // Create a new module (and put it into the cache)
2074
- /******/ var i = t[a] = {
2671
+ /******/ var s = t[r] = {
2075
2672
  /******/ // no module.id needed
2076
2673
  /******/ // no module.loaded needed
2077
2674
  /******/ exports: {}
2078
2675
  /******/ };
2079
2676
  /******/
2080
2677
  /******/ // Execute the module function
2081
- /******/ e[a](i, i.exports, n);
2678
+ /******/ e[r](s, s.exports, n);
2082
2679
  /******/
2083
2680
  /******/ // Return the exports of the module
2084
- /******/ return i.exports;
2681
+ /******/ return s.exports;
2085
2682
  /******/ }
2086
2683
  /******/
2087
2684
  /************************************************************************/
@@ -2104,11 +2701,11 @@
2104
2701
  /******/ (() => {
2105
2702
  /******/ // define getter functions for harmony exports
2106
2703
  /******/ n.d = (e, t) => {
2107
- /******/ for (var a in t) {
2108
- /******/ if (n.o(t, a) && !n.o(e, a)) {
2109
- /******/ Object.defineProperty(e, a, {
2704
+ /******/ for (var r in t) {
2705
+ /******/ if (n.o(t, r) && !n.o(e, r)) {
2706
+ /******/ Object.defineProperty(e, r, {
2110
2707
  enumerable: true,
2111
- get: t[a]
2708
+ get: t[r]
2112
2709
  });
2113
2710
  /******/ }
2114
2711
  /******/ }
@@ -2136,25 +2733,25 @@
2136
2733
  /******/ };
2137
2734
  /******/ })();
2138
2735
  /******/
2139
- /************************************************************************/ var a = {};
2736
+ /************************************************************************/ var r = {};
2140
2737
  // This entry need to be wrapped in an IIFE because it need to be in strict mode.
2141
2738
  (() => {
2142
2739
  "use strict";
2143
2740
  // ESM COMPAT FLAG
2144
- n.r(a);
2741
+ n.r(r);
2145
2742
  // EXPORTS
2146
- n.d(a, {
2147
- default: () => /* reexport */ ie
2743
+ n.d(r, {
2744
+ default: () => /* reexport */ se
2148
2745
  });
2149
2746
  // CONCATENATED MODULE: external "react"
2150
2747
  const e = require("react");
2151
2748
  var t = n.n(e);
2152
2749
  // CONCATENATED MODULE: external "lodash/castArray"
2153
- const r = require("lodash/castArray");
2154
- var i = n.n(r);
2750
+ const a = require("lodash/castArray");
2751
+ var s = n.n(a);
2155
2752
  // CONCATENATED MODULE: external "lodash/flatten"
2156
- const s = require("lodash/flatten");
2157
- var o = n.n(s);
2753
+ const i = require("lodash/flatten");
2754
+ var o = n.n(i);
2158
2755
  // CONCATENATED MODULE: external "lodash/indexOf"
2159
2756
  const l = require("lodash/indexOf");
2160
2757
  var u = n.n(l);
@@ -2168,39 +2765,39 @@
2168
2765
  const f = require("prop-types");
2169
2766
  var m = n.n(f);
2170
2767
  // CONCATENATED MODULE: external "@splunk/react-ui/useResizeObserver"
2171
- const E = require("@splunk/react-ui/useResizeObserver");
2172
- var v = n.n(E);
2768
+ const b = require("@splunk/react-ui/useResizeObserver");
2769
+ var h = n.n(b);
2173
2770
  // CONCATENATED MODULE: external "styled-components"
2174
- const h = require("styled-components");
2175
- var b = n.n(h);
2771
+ const v = require("styled-components");
2772
+ var E = n.n(v);
2176
2773
  // CONCATENATED MODULE: external "@splunk/themes"
2177
2774
  const y = require("@splunk/themes");
2178
2775
  // CONCATENATED MODULE: ./src/Code/CodeStyles.ts
2179
2776
  var S = "lineHeightSpacious";
2180
2777
  var A = "spacingLarge";
2181
- var T = b().code.withConfig({
2778
+ var k = E().code.withConfig({
2182
2779
  displayName: "CodeStyles__StyledCode",
2183
2780
  componentId: "sc-1eq4k68-0"
2184
2781
  })([ "font-family:", ";position:relative;z-index:1;", ";" ], y.variables.monoFontFamily, (function(e) {
2185
2782
  var t = e.$isPlaintext;
2186
- return !t && (0, h.css)([ "color:", ";" ], y.variables.syntaxTeal);
2783
+ return !t && (0, v.css)([ "color:", ";" ], y.variables.syntaxTeal);
2187
2784
  }));
2188
- var I = b().pre.withConfig({
2785
+ var x = E().pre.withConfig({
2189
2786
  displayName: "CodeStyles__StyledPre",
2190
2787
  componentId: "sc-1eq4k68-1"
2191
2788
  })([ "", ";", ";line-height:", ";position:relative;text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;&:focus-visible{box-shadow:", ";}", " ", ";" ], y.mixins.reset("grid"), y.mixins.typography("monoBody"), y.variables[S], y.variables.focusShadow, (function(e) {
2192
2789
  var t = e.$showLineNumbers, n = e.$counterReset;
2193
- return t && (0, h.css)([ "grid-template-columns:min-content auto;counter-reset:linenumber ", ";" ], n);
2790
+ return t && (0, v.css)([ "grid-template-columns:min-content auto;counter-reset:linenumber ", ";" ], n);
2194
2791
  }), (function(e) {
2195
2792
  var t = e.$containerAppearance;
2196
- return t === "none" ? (0, h.css)([ "gap:", ";" ], y.variables.spacingMedium) : (0,
2197
- h.css)([ "background-color:", ";border-radius:", ";", "{margin:", ";}" ], y.variables.neutral50, y.variables.borderRadius, /* sc-sel */ T, y.variables[A]);
2793
+ return t === "none" ? (0, v.css)([ "gap:", ";" ], y.variables.spacingMedium) : (0,
2794
+ v.css)([ "background-color:", ";border-radius:", ";", "{margin:", ";}" ], y.variables.neutral50, y.variables.borderRadius, /* sc-sel */ k, y.variables[A]);
2198
2795
  }));
2199
- var O = b().span.withConfig({
2796
+ var T = E().span.withConfig({
2200
2797
  displayName: "CodeStyles__StyledIndent",
2201
2798
  componentId: "sc-1eq4k68-2"
2202
2799
  })([ "&:not(:last-child){background-image:linear-gradient( to left,", " 1px,transparent 1px,transparent );}" ], y.variables.syntaxGray);
2203
- var N = {
2800
+ var I = {
2204
2801
  comment: y.variables.syntaxGray,
2205
2802
  prolog: y.variables.syntaxGray,
2206
2803
  doctype: y.variables.syntaxGray,
@@ -2231,12 +2828,12 @@
2231
2828
  important: y.variables.syntaxOrange,
2232
2829
  variable: y.variables.syntaxOrange
2233
2830
  };
2234
- var x = b().span.withConfig({
2831
+ var R = E().span.withConfig({
2235
2832
  displayName: "CodeStyles__StyledToken",
2236
2833
  componentId: "sc-1eq4k68-3"
2237
2834
  })([ "color:", ";cursor:", ";opacity:", ";font-style:", ";font-weight:", ";" ], (function(e) {
2238
2835
  var t = e.partType;
2239
- return N[t];
2836
+ return I[t];
2240
2837
  }), (function(e) {
2241
2838
  var t = e.partType;
2242
2839
  return t === "entity" ? "help" : null;
@@ -2251,7 +2848,7 @@
2251
2848
  return t === "important" || t === "bold" ? y.variables.fontWeightBold : null;
2252
2849
  }));
2253
2850
  // CONCATENATED MODULE: ./src/Code/LineHighlightsStyles.ts
2254
- var R = b().div.withConfig({
2851
+ var w = E().div.withConfig({
2255
2852
  displayName: "LineHighlightsStyles__StyledLineHighlight",
2256
2853
  componentId: "sc-1x2b02z-0"
2257
2854
  })([ "position:absolute;left:0;height:1lh;background:", ";border-left:2px solid ", ";pointer-events:none;line-height:inherit;width:", "px;", ";" ], y.variables.notificationColorInfoWeak, y.variables.notificationColorInfo, (function(e) {
@@ -2259,69 +2856,69 @@
2259
2856
  return t;
2260
2857
  }), (function(e) {
2261
2858
  var t = e.$containerAppearance, n = e.$lineNum;
2262
- return t === "none" ? (0, h.css)([ "top:calc(", " * ", "em);" ], n - 1, y.variables[S]) : (0,
2263
- h.css)([ "top:calc( ", " * ", "em + ", " );" ], n - 1, y.variables[S], y.variables[A]);
2859
+ return t === "none" ? (0, v.css)([ "top:calc(", " * ", "em);" ], n - 1, y.variables[S]) : (0,
2860
+ v.css)([ "top:calc( ", " * ", "em + ", " );" ], n - 1, y.variables[S], y.variables[A]);
2264
2861
  }));
2265
2862
  // CONCATENATED MODULE: ./src/Code/LineHighlights.tsx
2266
- function k(e, t) {
2267
- return D(e) || C(e, t) || F(e, t) || L();
2863
+ function N(e, t) {
2864
+ return C(e) || F(e, t) || _(e, t) || O();
2268
2865
  }
2269
- function L() {
2866
+ function O() {
2270
2867
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2271
2868
  }
2272
- function F(e, t) {
2869
+ function _(e, t) {
2273
2870
  if (e) {
2274
- if ("string" == typeof e) return w(e, t);
2871
+ if ("string" == typeof e) return L(e, t);
2275
2872
  var n = {}.toString.call(e).slice(8, -1);
2276
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? w(e, t) : void 0;
2873
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? L(e, t) : void 0;
2277
2874
  }
2278
2875
  }
2279
- function w(e, t) {
2876
+ function L(e, t) {
2280
2877
  (null == t || t > e.length) && (t = e.length);
2281
- for (var n = 0, a = Array(t); n < t; n++) {
2282
- a[n] = e[n];
2878
+ for (var n = 0, r = Array(t); n < t; n++) {
2879
+ r[n] = e[n];
2283
2880
  }
2284
- return a;
2881
+ return r;
2285
2882
  }
2286
- function C(e, t) {
2883
+ function F(e, t) {
2287
2884
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
2288
2885
  if (null != n) {
2289
- var a, r, i, s, o = [], l = !0, u = !1;
2886
+ var r, a, s, i, o = [], l = !0, u = !1;
2290
2887
  try {
2291
- if (i = (n = n.call(e)).next, 0 === t) {
2888
+ if (s = (n = n.call(e)).next, 0 === t) {
2292
2889
  if (Object(n) !== n) return;
2293
2890
  l = !1;
2294
- } else for (;!(l = (a = i.call(n)).done) && (o.push(a.value), o.length !== t); l = !0) {
2891
+ } else for (;!(l = (r = s.call(n)).done) && (o.push(r.value), o.length !== t); l = !0) {
2295
2892
  }
2296
2893
  } catch (e) {
2297
- u = !0, r = e;
2894
+ u = !0, a = e;
2298
2895
  } finally {
2299
2896
  try {
2300
- if (!l && null != n["return"] && (s = n["return"](), Object(s) !== s)) return;
2897
+ if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
2301
2898
  } finally {
2302
- if (u) throw r;
2899
+ if (u) throw a;
2303
2900
  }
2304
2901
  }
2305
2902
  return o;
2306
2903
  }
2307
2904
  }
2308
- function D(e) {
2905
+ function C(e) {
2309
2906
  if (Array.isArray(e)) return e;
2310
2907
  }
2311
2908
  // parseHighlightLines will turn a string like "2,4-5" into an array of ranges like [[2, 2], [4, 5]]
2312
- var P = function e(t) {
2909
+ var D = function e(t) {
2313
2910
  return t.replace(/\s+/g, "").split(",").filter(Boolean).map((function(e) {
2314
- var t = e.split("-").map(Number), n = k(t, 2), a = n[0], r = n[1];
2315
- return [ a, r || a ];
2911
+ var t = e.split("-").map(Number), n = N(t, 2), r = n[0], a = n[1];
2912
+ return [ r, a || r ];
2316
2913
  }));
2317
2914
  };
2318
2915
  // Flatten the array of ranges into a single array of line numbers
2319
2916
  // example: [[2, 2], [4, 5]] will become [2, 4, 5]
2320
- var _ = function e(t) {
2917
+ var P = function e(t) {
2321
2918
  var n = t.map((function(e) {
2322
- var t = k(e, 2), n = t[0], a = t[1];
2919
+ var t = N(e, 2), n = t[0], r = t[1];
2323
2920
  return Array.from({
2324
- length: a - n + 1
2921
+ length: r - n + 1
2325
2922
  }, (function(e, t) {
2326
2923
  return n + t;
2327
2924
  }));
@@ -2332,42 +2929,42 @@
2332
2929
  // Remove duplicates
2333
2930
  };
2334
2931
  var $ = function e(n) {
2335
- var a = n.containerAppearance, r = n.highlight, i = n.width;
2336
- var s = P(r);
2337
- var o = _(s);
2932
+ var r = n.containerAppearance, a = n.highlight, s = n.width;
2933
+ var i = D(a);
2934
+ var o = P(i);
2338
2935
 
2339
2936
  return t().createElement(t().Fragment, null, o.map((function(e) {
2340
2937
 
2341
- return t().createElement(R, {
2938
+ return t().createElement(w, {
2342
2939
  key: e,
2343
2940
  className: "line-highlight",
2344
2941
  "aria-hidden": "true",
2345
- $containerAppearance: a,
2942
+ $containerAppearance: r,
2346
2943
  $lineNum: e,
2347
- $width: i
2944
+ $width: s
2348
2945
  });
2349
2946
  })));
2350
2947
  };
2351
2948
  /* harmony default export */ const U = $;
2352
2949
  // CONCATENATED MODULE: ./src/Code/LineNumbersStyles.ts
2353
- var M = b().span.withConfig({
2950
+ var B = E().span.withConfig({
2354
2951
  displayName: "LineNumbersStyles__StyledLineNumberRows",
2355
2952
  componentId: "sc-1h4k3dh-0"
2356
2953
  })([ "pointer-events:none;user-select:none;", ";& > span{display:block;counter-increment:linenumber;position:relative;z-index:1;&::before{display:block;content:counter(linenumber);color:", ";text-align:right;", "}}" ], (function(e) {
2357
2954
  var t = e.$containerAppearance;
2358
- return t === "none" ? (0, h.css)([ "border-right:1px solid ", ";z-index:1;" ], y.variables.borderColor) : (0,
2359
- h.css)([ "padding:", ";background-color:", ";" ], y.variables[A], y.variables.neutral200);
2955
+ return t === "none" ? (0, v.css)([ "border-right:1px solid ", ";z-index:1;" ], y.variables.borderColor) : (0,
2956
+ v.css)([ "padding:", ";background-color:", ";" ], y.variables[A], y.variables.neutral200);
2360
2957
  }), y.variables.contentColorDefault, (function(e) {
2361
2958
  var t = e.$containerAppearance;
2362
- return t === "none" && (0, h.css)([ "padding-inline-end:", ";" ], y.variables.spacingSmall);
2959
+ return t === "none" && (0, v.css)([ "padding-inline-end:", ";" ], y.variables.spacingSmall);
2363
2960
  }));
2364
2961
  // CONCATENATED MODULE: ./src/Code/LineNumbers.tsx
2365
- function B(e) {
2366
- var n = e.containerAppearance, a = n === void 0 ? "none" : n, r = e.value, i = r === void 0 ? "" : r;
2962
+ function M(e) {
2963
+ var n = e.containerAppearance, r = n === void 0 ? "none" : n, a = e.value, s = a === void 0 ? "" : a;
2367
2964
  // Use a regex to see how many lines there are in the value, then output an
2368
2965
  // empty span for each line. The numbers themselves are handled by the CSS counter.
2369
- var s = i.match(/\n(?!$)/g);
2370
- var o = s ? s.length + 1 : 1;
2966
+ var i = s.match(/\n(?!$)/g);
2967
+ var o = i ? i.length + 1 : 1;
2371
2968
  var l = Array.from({
2372
2969
  length: o
2373
2970
  }, (function(e, n) {
@@ -2377,15 +2974,15 @@
2377
2974
  });
2378
2975
  }));
2379
2976
 
2380
- return t().createElement(M, {
2381
- $containerAppearance: a,
2977
+ return t().createElement(B, {
2978
+ $containerAppearance: r,
2382
2979
  "aria-hidden": true
2383
2980
  }, l);
2384
2981
  }
2385
- /* harmony default export */ const G = B;
2982
+ /* harmony default export */ const G = M;
2386
2983
  // EXTERNAL MODULE: ./src/Code/prism/prism.empty
2387
- var H = n(74);
2388
- var j = n.n(H);
2984
+ var j = n(74);
2985
+ var H = n.n(j);
2389
2986
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
2390
2987
  /**
2391
2988
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -2406,24 +3003,24 @@
2406
3003
  }
2407
3004
  }
2408
3005
  // CONCATENATED MODULE: ./src/Code/Code.tsx
2409
- function Y() {
2410
- return Y = Object.assign ? Object.assign.bind() : function(e) {
3006
+ function W() {
3007
+ return W = Object.assign ? Object.assign.bind() : function(e) {
2411
3008
  for (var t = 1; t < arguments.length; t++) {
2412
3009
  var n = arguments[t];
2413
- for (var a in n) {
2414
- ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
3010
+ for (var r in n) {
3011
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
2415
3012
  }
2416
3013
  }
2417
3014
  return e;
2418
- }, Y.apply(null, arguments);
3015
+ }, W.apply(null, arguments);
2419
3016
  }
2420
- function X(e, t) {
2421
- return Z(e) || V(e, t) || q(e, t) || W();
3017
+ function Y(e, t) {
3018
+ return V(e) || Z(e, t) || X(e, t) || q();
2422
3019
  }
2423
- function W() {
3020
+ function q() {
2424
3021
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2425
3022
  }
2426
- function q(e, t) {
3023
+ function X(e, t) {
2427
3024
  if (e) {
2428
3025
  if ("string" == typeof e) return K(e, t);
2429
3026
  var n = {}.toString.call(e).slice(8, -1);
@@ -2432,54 +3029,54 @@
2432
3029
  }
2433
3030
  function K(e, t) {
2434
3031
  (null == t || t > e.length) && (t = e.length);
2435
- for (var n = 0, a = Array(t); n < t; n++) {
2436
- a[n] = e[n];
3032
+ for (var n = 0, r = Array(t); n < t; n++) {
3033
+ r[n] = e[n];
2437
3034
  }
2438
- return a;
3035
+ return r;
2439
3036
  }
2440
- function V(e, t) {
3037
+ function Z(e, t) {
2441
3038
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
2442
3039
  if (null != n) {
2443
- var a, r, i, s, o = [], l = !0, u = !1;
3040
+ var r, a, s, i, o = [], l = !0, u = !1;
2444
3041
  try {
2445
- if (i = (n = n.call(e)).next, 0 === t) {
3042
+ if (s = (n = n.call(e)).next, 0 === t) {
2446
3043
  if (Object(n) !== n) return;
2447
3044
  l = !1;
2448
- } else for (;!(l = (a = i.call(n)).done) && (o.push(a.value), o.length !== t); l = !0) {
3045
+ } else for (;!(l = (r = s.call(n)).done) && (o.push(r.value), o.length !== t); l = !0) {
2449
3046
  }
2450
3047
  } catch (e) {
2451
- u = !0, r = e;
3048
+ u = !0, a = e;
2452
3049
  } finally {
2453
3050
  try {
2454
- if (!l && null != n["return"] && (s = n["return"](), Object(s) !== s)) return;
3051
+ if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
2455
3052
  } finally {
2456
- if (u) throw r;
3053
+ if (u) throw a;
2457
3054
  }
2458
3055
  }
2459
3056
  return o;
2460
3057
  }
2461
3058
  }
2462
- function Z(e) {
3059
+ function V(e) {
2463
3060
  if (Array.isArray(e)) return e;
2464
3061
  }
2465
- function Q(e, t) {
3062
+ function J(e, t) {
2466
3063
  if (null == e) return {};
2467
- var n, a, r = J(e, t);
3064
+ var n, r, a = Q(e, t);
2468
3065
  if (Object.getOwnPropertySymbols) {
2469
- var i = Object.getOwnPropertySymbols(e);
2470
- for (a = 0; a < i.length; a++) {
2471
- n = i[a], -1 === t.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
3066
+ var s = Object.getOwnPropertySymbols(e);
3067
+ for (r = 0; r < s.length; r++) {
3068
+ n = s[r], -1 === t.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
2472
3069
  }
2473
3070
  }
2474
- return r;
3071
+ return a;
2475
3072
  }
2476
- function J(e, t) {
3073
+ function Q(e, t) {
2477
3074
  if (null == e) return {};
2478
3075
  var n = {};
2479
- for (var a in e) {
2480
- if ({}.hasOwnProperty.call(e, a)) {
2481
- if (-1 !== t.indexOf(a)) continue;
2482
- n[a] = e[a];
3076
+ for (var r in e) {
3077
+ if ({}.hasOwnProperty.call(e, r)) {
3078
+ if (-1 !== t.indexOf(r)) continue;
3079
+ n[r] = e[r];
2483
3080
  }
2484
3081
  }
2485
3082
  return n;
@@ -2488,17 +3085,17 @@
2488
3085
  // auto formatting. The import below points to an empty file which is replaced at build
2489
3086
  // time, see ./prism/build-isolated-prism.js for details.
2490
3087
  // typed as 'prismjs'
2491
- var ee = [ "bash", "clike", "css", "html", "json", "javascript", "js", "jsx", "typescript", "ts", "tsx", "markup", "mathml", "plain", "plaintext", "splunk-spl", "sql", "svg", "text", "txt", "xml", "yaml", "yml" ];
3088
+ var ee = [ "bash", "c", "clike", "cpp", "cs", "csharp", "css", "html", "javascript", "js", "json", "jsx", "markup", "mathml", "plain", "plaintext", "powershell", "py", "python", "sh", "shell", "splunk-spl", "sql", "svg", "text", "ts", "tsx", "txt", "typescript", "xml", "yaml", "yml" ];
2492
3089
  function te(e) {
2493
3090
  return [ "plain", "plaintext", "text", "txt" ].includes(e);
2494
3091
  }
2495
3092
  function ne(e, t) {
2496
3093
  if (te(t)) {
2497
- return j().tokenize(e, {});
3094
+ return H().tokenize(e, {});
2498
3095
  }
2499
- return j().tokenize(e, j().languages[t]);
3096
+ return H().tokenize(e, H().languages[t]);
2500
3097
  }
2501
- var ae = {
3098
+ var re = {
2502
3099
  containerAppearance: m().oneOf([ "none", "section" ]),
2503
3100
  elementRef: m().oneOfType([ m().func, m().object ]),
2504
3101
  indentChars: m().number,
@@ -2510,105 +3107,105 @@
2510
3107
  showLineNumbers: m().bool,
2511
3108
  value: m().string
2512
3109
  };
2513
- function re(n) {
2514
- var a = n.containerAppearance, r = a === void 0 ? "none" : a, s = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, E = n.lineHighlights, h = n.lineNumberStart, b = n.showIndentGuide, y = b === void 0 ? true : b, S = n.showLineNumbers, A = n.value, N = A === void 0 ? "" : A, R = Q(n, [ "containerAppearance", "elementRef", "indentChars", "language", "languageFallback", "lineHighlights", "lineNumberStart", "showIndentGuide", "showLineNumbers", "value" ]);
3110
+ function ae(n) {
3111
+ var r = n.containerAppearance, a = r === void 0 ? "none" : r, i = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, b = n.lineHighlights, v = n.lineNumberStart, E = n.showIndentGuide, y = E === void 0 ? true : E, S = n.showLineNumbers, A = n.value, I = A === void 0 ? "" : A, w = J(n, [ "containerAppearance", "elementRef", "indentChars", "language", "languageFallback", "lineHighlights", "lineNumberStart", "showIndentGuide", "showLineNumbers", "value" ]);
2515
3112
  // @docs-props-type CodePropsBase
2516
- var k = (0, e.useRef)(null);
2517
- var L = (0, e.useState)(undefined), F = X(L, 2), w = F[0], C = F[1];
2518
- var D = v()(k), P = D.width, _ = D.height;
3113
+ var N = (0, e.useRef)(null);
3114
+ var O = (0, e.useState)(undefined), _ = Y(O, 2), L = _[0], F = _[1];
3115
+ var C = h()(N), D = C.width, P = C.height;
2519
3116
  var $ = (0, e.useCallback)((function(e) {
2520
- z(k, e);
2521
- z(s, e);
2522
- }), [ s ]);
3117
+ z(N, e);
3118
+ z(i, e);
3119
+ }), [ i ]);
2523
3120
  (0, e.useEffect)((function() {
2524
- var e = k.current;
3121
+ var e = N.current;
2525
3122
  if (e) {
2526
- var t = e.scrollHeight > Math.round(_);
2527
- var n = e.scrollWidth > Math.round(P);
2528
- var a = t || n;
2529
- C(a ? 0 : undefined);
3123
+ var t = e.scrollHeight > Math.round(P);
3124
+ var n = e.scrollWidth > Math.round(D);
3125
+ var r = t || n;
3126
+ F(r ? 0 : undefined);
2530
3127
  }
2531
- }), [ k, P, _ ]);
2532
- var M = p()(" ", c);
2533
- var B = function e(n) {
2534
- var a = Math.floor(n / c);
2535
- var r = n % c;
2536
- var i = g()(a, (function(e) {
3128
+ }), [ N, D, P ]);
3129
+ var B = p()(" ", c);
3130
+ var M = function e(n) {
3131
+ var r = Math.floor(n / c);
3132
+ var a = n % c;
3133
+ var s = g()(r, (function(e) {
2537
3134
 
2538
- return t().createElement(O, {
3135
+ return t().createElement(T, {
2539
3136
  key: e.toString()
2540
- }, M);
3137
+ }, B);
2541
3138
  }));
2542
- if (r) {
2543
- i.push(p()(" ", r));
3139
+ if (a) {
3140
+ s.push(p()(" ", a));
2544
3141
  }
2545
- return i;
3142
+ return s;
2546
3143
  };
2547
- var H = u()(ee, d) > -1;
3144
+ var j = d ? u()(ee, d) > -1 : true;
2548
3145
  (0, e.useEffect)((function() {
2549
3146
  // a fix for SUI-5425, where the Markdown component doesn't pass a valid language in some circumstances
2550
3147
  if (false) {}
2551
- }), [ H, d, m ]);
2552
- var j = H && d ? d : m;
2553
- var W = ne(N, j);
2554
- var q = te(j);
3148
+ }), [ j, d, m ]);
3149
+ var H = j && d ? d : m;
3150
+ var q = ne(I, H);
3151
+ var X = te(H);
2555
3152
  var K = function e(n) {
2556
- return i()(n).map((function(n, a) {
3153
+ return s()(n).map((function(n, r) {
2557
3154
  if (typeof n === "string") {
2558
3155
  if (!y) {
2559
3156
  return n;
2560
3157
  }
2561
- var r = n.split("\n");
2562
- if (r.length === 1) {
3158
+ var a = n.split("\n");
3159
+ if (a.length === 1) {
2563
3160
  return n;
2564
3161
  }
2565
- return o()(r.map((function(e, n) {
2566
- var r = n === 0 ? [] : [ "\n" ];
2567
- var i = e.match(/^(\s+)(.*)/);
2568
- if (!i) {
2569
- r.push(e);
3162
+ return o()(a.map((function(e, n) {
3163
+ var a = n === 0 ? [] : [ "\n" ];
3164
+ var s = e.match(/^(\s+)(.*)/);
3165
+ if (!s) {
3166
+ a.push(e);
2570
3167
  } else {
2571
- r.push( t().createElement("span", {
2572
- key: "".concat(a.toString(), ":").concat(n.toString())
2573
- }, B(i[1].length)), i[2]);
3168
+ a.push( t().createElement("span", {
3169
+ key: "".concat(r.toString(), ":").concat(n.toString())
3170
+ }, M(s[1].length)), s[2]);
2574
3171
  }
2575
- return r;
3172
+ return a;
2576
3173
  })));
2577
3174
  }
2578
- var i = typeof n.content === "string" ? n.content : e(n.content);
3175
+ var s = typeof n.content === "string" ? n.content : e(n.content);
2579
3176
 
2580
3177
  // eslint-disable-next-line react/no-array-index-key
2581
- return t().createElement(x, {
3178
+ return t().createElement(R, {
2582
3179
  "data-part-type": n.type,
2583
3180
  partType: n.type,
2584
- key: a.toString()
2585
- }, i);
3181
+ key: r.toString()
3182
+ }, s);
2586
3183
  }));
2587
3184
  };
2588
- var V = K(W);
3185
+ var Z = K(q);
2589
3186
 
2590
- return t().createElement(I, Y({
3187
+ return t().createElement(x, W({
2591
3188
  "data-test": "code",
2592
3189
  ref: $,
2593
- tabIndex: w,
2594
- $containerAppearance: r,
3190
+ tabIndex: L,
3191
+ $containerAppearance: a,
2595
3192
  $showLineNumbers: S,
2596
- $counterReset: h && h - 1
2597
- }, R), S && t().createElement(G, {
2598
- containerAppearance: r,
2599
- value: N
2600
- }), t().createElement(T, {
2601
- className: "language-".concat(j),
2602
- $isPlaintext: q
2603
- }, V), E && t().createElement(U, {
2604
- containerAppearance: r,
2605
- width: P,
2606
- highlight: E
3193
+ $counterReset: v && v - 1
3194
+ }, w), S && t().createElement(G, {
3195
+ containerAppearance: a,
3196
+ value: I
3197
+ }), t().createElement(k, {
3198
+ className: "language-".concat(H),
3199
+ $isPlaintext: X
3200
+ }, Z), b && t().createElement(U, {
3201
+ containerAppearance: a,
3202
+ width: D,
3203
+ highlight: b
2607
3204
  }));
2608
3205
  }
2609
- re.propTypes = ae;
2610
- /* harmony default export */ const ie = re;
3206
+ ae.propTypes = re;
3207
+ /* harmony default export */ const se = ae;
2611
3208
  }) // CONCATENATED MODULE: ./src/Code/index.ts
2612
3209
  ();
2613
- module.exports = a;
3210
+ module.exports = r;
2614
3211
  /******/})();